Bug 1668521 (CVE-2019-3842) - CVE-2019-3842 systemd: Spoofing of XDG_SEAT allows for actions to be checked against "allow_active" instead of "allow_any"
Summary: CVE-2019-3842 systemd: Spoofing of XDG_SEAT allows for actions to be checked ...
Status: NEW
Alias: CVE-2019-3842
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=moderate,public=20190408,repor...
Keywords: Security
Depends On: 1685443 1687514 1698045
Blocks: 1668522
TreeView+ depends on / blocked
 
Reported: 2019-01-23 01:23 UTC by Sam Fowler
Modified: 2019-06-11 10:48 UTC (History)
10 users (show)

(edit)
It was discovered that pam_systemd does not properly sanitize the environment before using the XDG_SEAT variable. It is possible for an attacker, in some particular configurations, to set a XDG_SEAT environment variable which allows for commands to be checked against polkit policies using the "allow_active" element rather than "allow_any".
Clone Of:
(edit)
Last Closed:


Attachments (Terms of Use)

Description Sam Fowler 2019-01-23 01:23:07 UTC
systemd has a vulnerability in the PAM module, pam_systemd, that allows for spoofing of the XDG_SEAT environment variable which allows for commands to be checked against polkit policies using the "allow_active" element rather than "allow_any". Users with local access to machines with an active tty sessions can exploit this to elevate their privileges.

Comment 1 Riccardo Schirone 2019-03-01 15:44:01 UTC
pam_systemd uses getenv() to retrieve XDG_SEAT value, however when pam_systemd is used by a SUID binary this allows a unprivileged user, in some circumstances, to provide a fake XDG_SEAT value, with the consequences mentioned in comment 0.

Comment 2 Riccardo Schirone 2019-03-01 15:49:10 UTC
For the attack to be successful, a new session must be created and that is created by pam_systemd only if the calling process is not already part of a session. On Fedora/RHEL, in their default PAM configurations, it does not seem to be possible to let a session sneak in without systemd knowing about it, since pam_systemd is always called in every PAM config file.

Comment 9 Riccardo Schirone 2019-04-09 12:21:42 UTC
Upstream patch:
https://github.com/systemd/systemd/commit/83d4ab55336ff8a0643c6aa627b31e351a24040a

Comment 10 Riccardo Schirone 2019-04-09 13:56:21 UTC
Created systemd tracking bugs for this issue:

Affects: fedora-all [bug 1698045]

Comment 11 Riccardo Schirone 2019-04-09 15:30:06 UTC
Acknowledgments:

Name: Jann Horn (Google Project Zero)


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