Summary
OpenPrinting CUPS before 2.4.17 contains an input validation flaw in how page-border values are parsed for shared PostScript queues on network-exposed cupsd instances.
By injecting newline characters into specific job options, an unauthenticated remote client may cause the scheduler to interpret attacker-controlled data as trusted control records, ultimately executing an existing system binary as the lp user.
Affected context
The vulnerability arises in CUPS deployments where:
- cupsd is reachable over the network, and
- a target print queue is shared and configured as a PostScript queue, and
- unauthenticated clients can submit print jobs to that shared queue.
Under these conditions, the scheduler's handling of certain print job options (such as page-border) can treat user-supplied text as trusted scheduler control data during re-parsing of PPD-like content.
Exploit preconditions
- Attack surface: Network-exposed cupsd service with at least one shared PostScript print queue.
- Required access: Ability to reach the CUPS TCP/IPP endpoint; no prior authentication needed for the vulnerable queue.
- Trigger point: Submission of a specially crafted Print-Job that supplies a page-border value containing a newline embedded in textWithoutLanguage data, followed by a raw print job to leverage the misinterpreted control record.
- Why exploitation is possible: The server preserves an embedded newline through option escaping and reparse logic and then reparses the second line of the attacker-influenced text as a trusted scheduler control record. This breaks the intended separation between untrusted job options and internal control syntax, allowing an attacker to reference and execute an existing system binary as lp.
Why this happens
The core issue is improper input validation and sanitization of textWithoutLanguage job options before they are integrated into internal control-like data structures.
The page-border value is accepted as free-form text, but the parsing and escaping logic fails to neutralize embedded newline characters that carry semantic meaning in the subsequent reparse step.
As a result, attacker-supplied data crosses a trust boundary: it is first treated as untrusted option text, then later reparsed as a scheduler control record with elevated interpretive semantics.
This aligns with CWE-20: Improper Input Validation, where the system does not adequately constrain, sanitize, or validate input before it is used in a security-sensitive context such as command or control record interpretation.
Potential impact
- Remote execution of an existing system binary (e.g.,
/usr/bin/vim) as the lp user. - Abuse of the lp account to read, modify, or delete print-related files and spool data accessible to that user.
- Establishment of a local foothold on the print server that may facilitate further privilege escalation through separate weaknesses or misconfigurations.
- Disruption of printing services via arbitrary process execution or job manipulation.
- Potential lateral movement in environments where the print server has access to other sensitive resources.
General mitigation guidance
Since patches may not be immediately available, mitigation generally focuses on reducing exposure and hardening input handling paths:
- Restrict or disable unauthenticated access to shared PostScript queues; prefer authenticated IPP usage and access control lists for print submission.
- Limit network exposure of cupsd by placing it behind firewalls or access gateways and allowing only trusted subnets or hosts.
- Avoid exposing raw or PostScript queues to untrusted clients; use queues and drivers that minimize direct interpretation of client-supplied control-like text.
- Apply configuration hardening to the lp environment (e.g., restricting PATH, disabling unnecessary helpers, using AppArmor/SELinux profiles) so that arbitrary binary execution is less impactful.
- Where possible, validate or constrain acceptable page-border and similar text options at a higher layer (such as print portals or job submission frontends) to remove unexpected control characters.
Long term, secure patterns include systematically treating all client-supplied print options as untrusted data and ensuring they are strictly sanitized before being passed into any control, configuration, or command-processing layer.
How teams detect issues like this
Effective detection typically combines configuration review with behavioral and code-level analysis:
- Configuration and deployment review: Identify CUPS instances with network-exposed, shared PostScript queues that accept unauthenticated jobs; flag these for priority mitigation.
- Static analysis and code inspection: Look for parsing routines that take user-controlled textWithoutLanguage or similar options and later reparse them as PPD or control-like records, especially where newline or delimiter handling is incomplete.
- Log and behavior monitoring: Enable detailed CUPS logging and alert on anomalous job options (e.g., unusual page-border values, unexpected control characters) and on print jobs that result in non-print binaries being invoked under the lp user.
- Policy and CI enforcement: Integrate secure coding checks into development pipelines for print-related components, enforcing policies that forbid direct re-interpretation of user data as control syntax without strict validation.
Automated security scanners and SAST tools can be configured with rules to detect patterns where user input flows into command, control record, or configuration parsing logic without proper sanitization.

