Critical Remote Code Execution Vulnerability Discovered in CUPS:
The cups-browsed service trusts packets from any source and can be tricked into contacting a malicious IPP server, which then supplies unvalidated attributes that are written into a PPD file and can lead to arbitrary command execution. An attacker could run commands on a vulnerable system when a print job is initiated.
A significant security threat has emerged in the Common Unix Printing System (CUPS) that could affect Linux and other UNIX-based operating systems, including macOS. This vulnerability, identified by Italian security researcher Simone Margaritelli, allows malicious attackers to execute arbitrary commands on vulnerable…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the combination of cups-browsed trusting packets from any source, libcupsfilters and libppd failing to validate IPP attributes, and cups-filters allowing command execution through a PPD parameter.
Impact
An attacker could execute arbitrary commands on vulnerable systems, though some researchers believe the actual impact may be lower than the 9.9 CVSS score suggests.
What the attacker needed
Cups-browsed service running; network access to UDP port 631; attacker controls a malicious IPP server; a print job is initiated
The fix
There is no official patch; mitigations include disabling or removing cups-browsed, updating CUPS, blocking UDP port 631 from untrusted sources, and blocking DNS-SD.
How it was found
- Send UDP packets to port 631 on a vulnerable host.
- Replace the existing printer IPP URL with a malicious server URL.
- The malicious server returns crafted IPP attributes that are not validated.
- The attributes are written into a temporary PPD file.
- A print job is initiated, triggering arbitrary command execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
CUPS is the printing system on Linux and macOS. A background service called cups-browsed listens for printer announcements from the network and does not check who sent them. An attacker can pretend to be a printer, send bad data that ends up in a printer configuration file, and that data can make the system run commands.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.