SecPod

Learn Search

Search across all Learn content

← Back to Security Research
A Cup Half Empty: Linux RCE Flaws Discovered In CUPS

A Cup Half Empty: Linux RCE Flaws Discovered In CUPS

It’s been a rough year for Linux! The XZ Utils bug caused tremors worldwide in March, and with the recent discovery of a potential chain attack on the CUPS open-source printing system, Linux seems to be caught in a veritable maelstrom of vulnerabilities.

Sep 30, 2024By Meghana Raatni6 min read

It’s been a rough year for Linux! The XZ Utils bug caused tremors worldwide in March, and with the recent discovery of a potential chain attack on the CUPS open-source printing system, Linux seems to be caught in a veritable maelstrom of vulnerabilities.

The flaws involved are present within various components of the Common UNIX Printing System, otherwise known as CUPS. This is the most widely used printing system across Linux devices, and the flaws are fairly easy to exploit. Despite the 9.9 CVSS rating and the potential of RCE, the impact is estimated to be relatively low; only systems with very specific configurations can be exploited. This vulnerability, therefore, isn’t necessarily every attacker’s cup of tea.

Technical Details

Before we get into the details of the exploit crafted by researcher Simone “EvilSocket” Margaritelli, let’s take a look at the flaws that comprise it. The affected components are cups-browsed, libcupsfilters, libppd, and cups-filters.

  • CVE-2024-47176: In cups-browsed version 2.0.1 and earlier, the service binds to UDP INADDR_ANY:631, accepting packets from any source, which can trigger a “Get-Printer-Attributes” IPP request to a URL controlled by an attacker.
  • CVE-2024-47076: In libcupsfilters version 2.1b1 and earlier, the function cfGetPrinterAttributes5 fails to validate or sanitize IPP attributes received from an IPP server, allowing attacker-controlled data to be processed by the rest of the CUPS system.
  • CVE-2024-47175: In libppd version 2.1b1 and earlier, the function ppdCreatePPDFromIPP2 does not properly validate or sanitize IPP attributes when writing to a temporary PPD file, enabling the injection of attacker-controlled data into the resulting PPD file.
  • CVE-2024-47177: In cups-filters version 2.0.1 and earlier, the foomatic-rip utility allows arbitrary command execution through the FoomaticRIPCommandLine parameter in PPD files.

A remote, unauthenticated attacker can chain these flaws to achieve RCE by sending a UDP packet to port 631. How, you ask? Here’s the breakdown:

The cups-browsed component handles the discovery of new printers and automatically adds them to the system. It listens on port 631, checks whether connection requests are from a valid source, parses two text fields from the packets received, and passes them on to the found_cups_printer function. Despite the validity check, however, the configuration file for cups-browsed is completely commented out, so connection requests from just about anyone will go through anyway. This is CVE-2024-47176.

One of the text fields sent to the found_cups_printer function is a URL, which is eventually used in cfGetPrinterAttributes5 from libcupsfilters, resulting in cups-browsed connecting to said URL. Essentially, an attacker can send a packet containing some malicious URL to any arbitrary IP running CUPS, and the IP will assume it’s from an IPP server and connect back to the URL.

IPP (which stands for Internet Printing Protocol) is used to facilitate communication between printers and client devices. Once an attacker gets the CUPS IP to connect to their malicious server, and the IP assumes the server is a printer, it will send a GetPrinterAttributes request to obtain information about said printer. It will then register it under its local printers without any further confirmation steps or notifying the user at all, which undoubtedly gives the attacker the most effortless infiltration process of their life. This is CVE-2024-47076.

The attributes are then sent to a temporary PPD (PostScript Printer Definition) file, created with ppdCreatePPDFromIPP2 in the component libppd without any input sanitization. This is CVE-2024-47175. PPD files are used by vendors to describe all the features and commands available to their printers. Here, executables known as filters become relevant. CUPS contains a particularly dangerous filter known as foomatic-rip, which enables the execution of any attacker-specified command via the FoomaticRIPCommandLine directive in PPD files upon sending a print job.

Though the dangers of foomatic-rip are known to the CUPS developers, a permanent fix might cause older printer models to stop working on UNIX completely, so there is no patch in sight as of now. This is CVE-2024-47177.

With all this information in mind, the actual workings of the exploit should be transparent:

  • The target machine connects to the malicious IPP server via port 631.
  • The attacker specifies PPD directives within an attribute string in response to a GetPrinterAttributes request.
  • When a print job is sent to the fake printer, the malicious command within the directives are executed.

Impact

As mentioned earlier, the simplicity of this exploit is alarming, but potentially misleading in terms of real-world impact. There are many conditions that must be satisfied for a system to be vulnerable, such as the following:

  • The cups-browsed service needs to be manually started in order to expose port 631.
  • The victim must attempt to print from the malicious server added to their list of printers.
  • The attacker must be able to establish a connection to the computer via UDP, which is commonly disabled.

Then, and only then, can an attacker conduct RCE.

Products Affected

Most GNU/Linux distributions, Oracle Solaris, and potentially Google Chromium/ChromeOS have cups-browsed packaged. There could be other vulnerable distributions as well, since CUPS is supported on UNIX-like operating systems such as FreeBSD, NetBSD, and OpenBSD.

Mitigations and Solutions

Red Hat customers can determine whether their system has cups-browsed running with the following command: sudo systemctl status cups-browsed

To mitigate this vulnerability, run the following commands. These will stop cups-browsed from running and prevent it from starting on reboot.

sudo systemctl stop cups-browsedsudo systemctl disable cups-browsed

Patches are still being developed, so make sure to apply the mitigation technique; there are possibly hundreds of thousands of vulnerable Linux/UNIX users at the moment and you don’t want to be one of them. Taking the right measures to keep your device protected always pays off. A bitter cup today, a sweet reward tomorrow!

Instantly Fix Risks with SanerNow Patch Management

SanerNow patch management is a continuous, automated, and integrated software that instantly fixes risks exploited in the wild. The software supports major operating systems like Windows, Linux, and macOS, as well as 550+ third-party applications.

It also allows you to set up a safe testing area to test patches before deploying them in a primary production environment. SanerNow patch management additionally supports a patch rollback feature in case of patch failure or a system malfunction.

Experience the fastest and most accurate patching software here.

Featured Posts

Open Critical Security Flaws in Microsoft Office, Erlang/OTP and Mozilla Thunderbird: November 25, 2026
Critical Security Flaws in Microsoft Office, Erlang/OTP and Mozilla Thunderbird: November 25, 2026

CVE Research

Critical Security Flaws in Microsoft Office, Erlang/OTP and Mozilla Thunderbird: November 25, 2026

Critical security flaws disclosed in November 2026 affect Microsoft Office, Erlang/OTP, and Mozilla Thunderbird. Explore CVE-2026-112732, CVE-2026-124286, and CVE-2026-136226, including remote code execution, TLS server impersonation, email spoofing risks, affected versions, and fixes.

Nov 25, 2026

Open Critical Vulnerabilities, November 23, 2026: Ruby2Shell in GitLab CE/EE and Seven rclone Flaws
vulnerability researchCritical Vulnerabilities, November 23, 2026: Ruby2Shell in GitLab CE/EE and Seven rclone Flaws

CVE Research

Critical Vulnerabilities, November 23, 2026: Ruby2Shell in GitLab CE/EE and Seven rclone Flaws

Nov 24, 2026

Open Three Critical Vulnerabilities in rConfig, Wing FTP Server and Google Chrome: 23 November 2026 Security Research
Three Critical Vulnerabilities in rConfig, Wing FTP Server and Google Chrome: 23 November 2026 Security Research

CVE Research

Three Critical Vulnerabilities in rConfig, Wing FTP Server and Google Chrome: 23 November 2026 Security Research

Explore three critical vulnerabilities affecting rConfig, Wing FTP Server, and Google Chrome, including technical root causes, exploitation risks, CVSS scores, attack-flow diagrams, MITRE ATT&CK assessment, and recommended security updates.

Nov 24, 2026

Open Beyond the Hypervisor: ARMORY CASTLE's VMware vCenter Zero-Day Exploitation and Data Theft
Beyond the Hypervisor: ARMORY CASTLE's VMware vCenter Zero-Day Exploitation and Data Theft

CVE Research

Beyond the Hypervisor: ARMORY CASTLE's VMware vCenter Zero-Day Exploitation and Data Theft

ARMORY CASTLE, a suspected China-nexus espionage group, exploited vulnerabilities in BeyondTrust Remote Support and VMware vCenter to gain access to enterprise environments, compromise virtualization infrastructure, steal credentials, and extract virtual machine data. The operation involved custom malware, privilege escalation, SAML token forgery, and persistent access to compromised systems.

Nov 23, 2026