CUPS RCE — CVE-2024-47176
CVE-2024-47176 is part of a four-CVE chain disclosed in September 2024 that enables unauthenticated remote code execution on systems running cups-browsed. The attack works by sending a crafted UDP packet to port 631 that causes cups-browsed to connect back to an attacker-controlled IPP server. The malicious IPP server advertises a printer with a crafted PPD file containing a command injection payload. When a user or automated process triggers a print job on the malicious printer, the injected command executes as the lp or cups user. The full chain requires CVE-2024-47176 (cups-browsed), CVE-2024-47076 (libcupsfilters), CVE-2024-47175 (libcups), and CVE-2024-47177 (cups-filters).
Affected Versions
Component | Vulnerable | Fixed in |
|---|---|---|
cups-browsed | All versions before 2.0.1 | 2.0.1 |
CUPS | Before 2.4.11 | 2.4.11 |
libcupsfilters | Before 2.1.0 | 2.1.0 |
cups-filters | Before 2.0.1 | 2.0.1 |
Prerequisites Check
Three conditions must be true for the attack to work:
<title>Home - CUPS 2.4.2</title>
Explain command
| -s | Silent mode; suppresses progress meter and error messages. |
| -k | Allow insecure TLS connections, skipping certificate verification. |
| http://$TARGET_IP:631/ | Target URL with variable IP, hitting default CUPS port 631. |
| -i | Case-insensitive pattern matching for grep search. |
631/udp open ipp
Connection from 10.10.10.50:631 GET /printers/probe HTTP/1.1
Explain command
| -l | Listen mode, waits for incoming connections. |
| -v | Verbose output, shows connection details. |
| -n | Skip DNS resolution, use numeric IPs only. |
| -u | Use UDP protocol instead of TCP. |
| -p 631 | Bind to local port 631 (IPP/CUPS port). |
| -e | Enable interpretation of backslash escape sequences. |
| 0 3 http://$LHOST:631/printers/probe | Crafted CUPS browse packet pointing callback URL to attacker host. |
| -u | Send data via UDP to the target. |
| $TARGET_IP 631 | Target host IP and UDP port 631 to reach cups-browsed. |
An inbound HTTP GET from the target to your host confirms cups-browsed is running, is reachable via UDP 631, and will follow attacker-controlled URLs. All prerequisites are met. Move to CUPS malicious printer RCE for the full exploitation chain.
Version Check via SSH or Local Access
When you have local access or SSH to the target, confirm exact package versions:
cups 2.4.2-7ubuntu5 cups-browsed 2.0.0-0ubuntu4 libcupsfilters1 1.28.17-3ubuntu2 cups-filters 1.28.17-3ubuntu2
Explain command
| -l | List installed packages matching the given name patterns. |
| 2>/dev/null | Redirect stderr to /dev/null to suppress error messages. |
| -E | Enable extended regular expressions in grep pattern matching. |
| '^ii' | Pattern matching lines starting with 'ii' (installed packages). |
| '{print $2,$3}' | Print the package name (field 2) and version (field 3). |
active cups-browsed running
Nuclei Detection
[CVE-2024-47176] [critical] http://10.10.10.50:631 [CUPS RCE via cups-browsed]
Explain command
| -u | Target URL to scan. |
| http://$TARGET_IP:631/ | Target host and port placeholder; 631 is the CUPS service port. |
| -tags | Filter templates by specified tags. |
| cve2024-47176,cups | Run only templates tagged with CVE-2024-47176 or cups. |
| -severity | Filter templates by severity level. |
| critical,high | Only run templates rated critical or high severity. |
References
-
Simone Margaritelli — Attacking UNIX systems via CUPSwww.evilsocket.net/2024/09/26/Attacking-UNIX-systems-via-CUPS-Part-I (opens in new tab)
Original disclosure and technical analysis of the full CVE-2024-47176 chain
-
CVE-2024-47176 PoC exploitation tool
Was this helpful?
Your feedback helps improve this page.