
Python proof-of-concept for CVE-2026-34990, reproducing the OpenPrinting CUPS local root file-write race with automatic verification and cleanup.
An authorized reproducer for an OpenPrinting CUPS local root file-write vulnerability.
An unprivileged local user can leak cupsd's root Local authentication token, exploit a
race involving a temporary local printer, and make root cupsd write controlled bytes to
an arbitrary path.
The default run is deliberately non-destructive: it writes and verifies a marker in a new private temporary directory, then removes the file and all queues it created.
Consult the vendor advisory for downstream package/backport status rather than relying only on a distribution's displayed version.
CUPS-Create-Local-Printer is pointed at an attacker-controlled loopback IPP
listener. A Local trc="y" authentication challenge makes cupsd disclose its root
Local token.CUPS-Add-Modify-Printer request containing a file://
destination is rejected with the default FileDevice No configuration.device-uri.This timing window is why the PoC retries. A failed attempt is expected and is not
reported as exploitation; success requires an independent file-content or command
check. CUPS commonly creates the target as root with mode 0600; for a new path, the
PoC therefore accepts either exact readable content or root ownership plus the expected
file size. Existing custom targets still require content or command verification.
FileDevice Yes is not required. If it is enabled, a simpler direct administrative
file-printer path exists, but that is not the default-configuration CVE chain reproduced
here.
The local CUPS socket is auto-detected. Use --tcp to reproduce the vendor's loopback
TCP transport explicitly, or --socket /path/to/cups.sock to select a socket.
Harmless proof, automatic verification, and automatic cleanup:
python3 cupsploit.py
Explicit privilege-escalation proof using a randomized sudoers fragment:
python3 cupsploit.py --escalate
That mode first confirms the sudo check does not already succeed, verifies uid 0 after
the race, and removes the sudoers fragment by default. Add --keep-artifacts only when
you intentionally want to retain the successful queue and target.
Arbitrary file-write testing is opt-in and refuses to overwrite an existing path unless the second acknowledgement is supplied:
python3 cupsploit.py \
--target /absolute/test/path \
--allow-arbitrary-write \
--content 'authorized test marker'
python3 cupsploit.py \
--target /absolute/existing/path \
--allow-arbitrary-write \
--force-overwrite \
--payload-file ./payload.bin \
--verify-command 'your independent verification command'
If the target cannot be read by the invoking user, provide --verify-command. It must
fail before exploitation and succeed afterward, preventing an unrelated pre-existing
condition from being reported as success. Race tuning is available through --attempts
and --iterations.
Unless --keep-artifacts is used, the script deletes the leak and candidate queues. It
also removes its harmless proof file or sudoers proof. A custom target is never deleted
automatically because it may be user-supplied data.
If a run is interrupted, use the CUPS administration interface to remove printers whose
names begin with cve34990, and manually inspect the selected target.
Run the standard-library protocol tests with python3 -m unittest -v.
For authorized security testing and research only. Use it only on systems you own or have explicit permission to test.