Bug 1607282 (CVE-2018-4180) - CVE-2018-4180 cups: Local privilege escalation to root due to insecure environment variable handling
Summary: CVE-2018-4180 cups: Local privilege escalation to root due to insecure enviro...
Alias: CVE-2018-4180
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1607293 1607295 1608720 1608721 1608722 1608764
Blocks: 1607292
TreeView+ depends on / blocked
Reported: 2018-07-23 08:05 UTC by Andrej Nemec
Modified: 2021-02-16 23:55 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
It was discovered that CUPS allows non-root users to pass environment variables to CUPS backends. Affected backends use attacker-controlled environment variables without proper sanitization. A local attacker, who is part of one of the groups specified in the SystemGroups directive, could use the cupsctl binary to set SetEnv and PassEnv directives and potentially controls the flow of the affected backend, resulting in some cases in arbitrary code execution with root privileges.
Clone Of:
Last Closed: 2020-03-31 22:32:48 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:1050 0 None None None 2020-03-31 19:16:10 UTC

Description Andrej Nemec 2018-07-23 08:05:15 UTC
Affected versions of CUPS allow for the SetEnv and PassEnv directives to be specified in the cupsd.conf file, which is editable by non-root users using the cupsctl binary.  This allows attacker-controlled environment variables to be passed to CUPS backends, some of which are run as root.  By passing malicious values in environment variables to affected backends, it is possible to execute an attacker-supplied binary as root, subject to sandbox restrictions.



Upstream patch:


Comment 1 Andrej Nemec 2018-07-23 08:30:39 UTC
Created cups tracking bugs for this issue:

Affects: fedora-all [bug 1607293]

Comment 6 Riccardo Schirone 2018-07-26 08:20:25 UTC
On Linux the sandbox feature is not enabled, however SELinux may restricts the allowed actions an attacker can accomplish. Moreover, on RHEL the SystemGroup defined in /etc/cups/cups-files.conf (or in /etc/cups/cupsd.conf in RHEL 5 and 6) only includes groups `sys` and `root`, thus reducing considerably the set of users who can run cupsctl and perform the attack.

Comment 7 Riccardo Schirone 2018-07-26 08:55:20 UTC
Decreasing the Impact of the flaw to Moderate, because of the high privileges required to exploit it.

Comment 8 Riccardo Schirone 2018-07-26 09:12:24 UTC

Do not add untrusted users to sys and root groups.

Comment 10 Riccardo Schirone 2018-07-27 09:31:24 UTC
Though RHEL 5 still allows to set PassEnv and SetEnv through cupsctl even by non-root users, it does not have the dnssd backend which allows an attacker to supply a binary which is executed with root permissions. For this reason the impact on RHEL 5 is Low.

Comment 11 errata-xmlrpc 2020-03-31 19:16:08 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:1050 https://access.redhat.com/errata/RHSA-2020:1050

Comment 12 Product Security DevOps Team 2020-03-31 22:32:48 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


Note You need to log in before you can comment on or make changes to this bug.