OpenPrinting ippusbxd media-size-supported stack based buffer overflow vulnerability
A stack-based buffer overflow in ippusbxd's parsing of the media-size-supported attribute from a connected printer allows a malicious USB device to overflow a local buffer. Since the service runs as root, this could lead to arbitrary code execution with high privileges.
Originally disclosed on Cisco Talos
A stack based buffer overflow vulnerability is present in OpenPrinting ippusbxd 1.34. A specially configured printer that supports IPP-over-USB can cause a buffer overflow which can lead to a arbitrary code execution in a privileged service.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code calculates the length of a substring from untrusted input and uses that length directly in a strncpy call without verifying it fits the destination buffer.
Impact
Successful exploitation could result in arbitrary code execution with high privileges, though the crash observed was due to a stack overflow mitigation that might not be present in all builds.
What the attacker needed
Malicious USB device; target runs ippusbxd; physical USB connection
The fix
The project is suspended; the recommended mitigation is to stop using ippusbxd and switch to ipp-usb.
How it was found
- Patch PAPPL to add a CMD tag to the printer descriptor so ippusbxd recognises the printer.
- Patch PAPPL to add a media-size-supported attribute with an overly long dimension string.
- Set the EXPLOIT_STRING environment variable to the malicious string.
- Run the PAPPL test application on a Raspberry Pi Zero to emulate a printer.
- Connect the Pi Zero to the target system via USB.
- The exploit triggers, causing a crash or potential code 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 report has not been written yet. The Original tab links to the source.
A printer connected via USB can send a specially crafted response to a request from a background service. The service copies part of that response into a fixed-size memory area without checking the length, causing an overflow. Because the service runs with full system rights, an attacker with a malicious printer could take over the computer.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.