Summary
OpenPrinting CUPS before 2.4.17 allows a local unprivileged user to trick cupsd into authenticating to an attacker-controlled IPP service on localhost using a reusable Authorization: Local ... token.
With this token, the attacker can issue privileged /admin/ requests, create a shared file:///... printer queue despite normal policy restrictions, and ultimately gain an arbitrary root file overwrite that can be leveraged for root command execution.
Affected context
The vulnerability arises in local CUPS deployments where:
- cupsd is running with administrative capabilities and manages printers on localhost
- The server is configured to accept
Authorization: Local ...authentication for administrative operations - Local users can influence or interact with IPP services bound to localhost
In such environments, cupsd may inadvertently reuse a locally scoped authorization token with an attacker-controlled IPP endpoint, effectively extending administrative trust to unprivileged local users who can then manipulate CUPS configuration and queues.
Exploit preconditions
- Attack surface: Local system; interaction with the CUPS IPP interface on localhost.
- Required access: An unprivileged local account capable of:
- Running processes that listen on localhost for IPP traffic, and
- Interacting with CUPS so that cupsd connects to the attacker-controlled service.
- Trigger point: cupsd is induced to authenticate to the attacker's localhost IPP service using a reusable
Authorization: Local ...token. - Why exploitation is possible: The design of the local authorization mechanism and its use across trust boundaries allows a bearer-style token to be:
- Sent by cupsd to an endpoint it does not fully control or validate, and
- Reused by the attacker to perform
/admin/operations, including creating sharedfile:///...queues that bypass the intended FileDevice restrictions.
Why this happens
This weakness maps to CWE-287: Improper Authentication: a local authorization mechanism is applied in a context where the recipient is not reliably authenticated and the token is treated as a reusable bearer credential.
At an abstract level:
- The system uses a locally scoped "trusted" authorization token to gate administrative endpoints.
- cupsd is willing to present that token to an IPP peer assumed to be trustworthy based solely on its localhost context.
- The attacker, by controlling that peer, can capture or otherwise leverage the token to impersonate an authenticated administrative client.
- Once authenticated, the attacker can invoke administrative IPP operations that normally require elevated privileges, including creating printer queues with backends (
file:///...) that should be blocked by policy.
This pattern reflects a flawed trust model and insufficient binding between authorization tokens, their intended peer, and the operations they are allowed to perform.
Potential impact
- Local unprivileged users could gain effective administrative control over CUPS.
- Attackers may create persistent
file:///...printer queues despite configured policies. - Printing to these queues could allow arbitrary root-level file overwrites on the host filesystem.
- Arbitrary file overwrite could be chained into full root command execution (e.g., via modification of configuration or policy files interpreted by root-level components).
- Long-term persistence of elevated privileges through modified system or service configuration.
General mitigation guidance
Defensive measures typically focus on tightening authentication semantics and reducing the power of local tokens:
- Revisit the design of "Local" authorization so that such tokens are:
- Bound to specific peers or channels, and
- Not reusable outside their original context or endpoint.
- Ensure that components like cupsd never send privileged bearer tokens to endpoints whose identity or ownership is not strongly verified, even if they reside on localhost.
- Apply stricter authorization checks for
/admin/operations, treating them as high-risk regardless of source address, and enforcing explicit authentication flows (e.g., user credential prompts, stronger local mechanisms). - Harden printing backend selection:
- Enforce FileDevice and backend policies in a central, invariant way that cannot be bypassed via administrative APIs.
- Require elevated, out-of-band authorization for creation of
file:///or other high-risk backends, or disable them entirely in general-purpose environments. - Reduce the blast radius of a compromise:
- Run cupsd with the least privileges necessary and isolate its file access.
- Restrict where CUPS can write on disk, particularly for spool, configuration, and log paths.
- In sensitive environments, limit who can interact with CUPS administration APIs on localhost, for example by using OS-level ACLs, containerization, or separate administrative interfaces that do not rely solely on local tokens.
How teams detect issues like this
Security teams can look for this class of issue through:
- Configuration and code review:
- Identify uses of locally scoped authentication tokens (
Authorization: Local ...or equivalents) and analyze where these tokens can be forwarded or reused. - Review IPP admin endpoints to confirm that administrative operations cannot be invoked solely on the basis of source address or loosely scoped local credentials.
- Examine backend creation logic for any path that allows high-risk backends (
file:///, direct filesystem access) to be created via APIs that might be reachable by non-privileged actors. - Static or policy-based analysis:
- Define rules that flag:
- Reuse of the same authorization token across different trust domains or peers.
- Any code path that conditions admin access only on localhost checks or similar weak signals.
- Employ automated configuration scanning to ensure FileDevice and backend restrictions are consistent with intended policy and cannot be overridden programmatically.
- Runtime monitoring and logging:
- Enable detailed logging for
/admin/requests, including the source process/user and the type of authentication used. - Monitor for the creation of new printer queues, especially those using
file:///or atypical backends. - Detect suspicious print jobs that target paths outside standard spool or temporary directories.

