Bug 988498 (CVE-2013-4169) - CVE-2013-4169 gdm: TOCTTOU race condition on /tmp/.X11-unix
Summary: CVE-2013-4169 gdm: TOCTTOU race condition on /tmp/.X11-unix
Alias: CVE-2013-4169
Product: Security Response
Classification: Other
Component: vulnerability   
(Show other bugs)
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Whiteboard: impact=important,public=20130905,repo...
Keywords: Security
Depends On: 997619 997620 997622 997624
Blocks: 988499
TreeView+ depends on / blocked
Reported: 2013-07-25 17:37 UTC by Vincent Danen
Modified: 2015-07-31 07:09 UTC (History)
7 users (show)

Fixed In Version: gdm 2.21.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-05 21:52:33 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch for gdm (2.90 KB, patch)
2013-09-06 18:38 UTC, Vincent Danen
no flags Details | Diff
patch for initscripts (550 bytes, patch)
2013-09-06 18:39 UTC, Vincent Danen
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1213 normal SHIPPED_LIVE Important: gdm security update 2013-09-05 22:54:55 UTC

Description Vincent Danen 2013-07-25 17:37:47 UTC
Vladz reported that GDM versions < 2.21.1 were vulnerable to a TOCTTOU (time of check to time of use) flaw in the way that GDM checked for the existence of, and created if missing, the /tmp/.X11-unix/ special directory.  A local attacker could use this flaw to overwrite arbitrary file contents via symbolic link attacks or to manipulate the contents of arbitrary files, including those files owned by the root user that would normally be inaccessible.  This is because GDM will chown /tmp/.X11-unix to the user and group root, but also changes the permissions to 1777.

Newer versions of GDM no longer create the /tmp/.X11-unix/ directory and are thus not vulnerable to this flaw.


Red Hat would like to thank the researcher with the nickname vladz for reporting this issue.

Comment 1 Vincent Danen 2013-07-25 17:45:34 UTC
One possible solution is to prevent GDM from ever creating this directory by pre-creating it in /etc/rc.sysinit (like we do for /tmp/.ICE-unix).  That or simply don't remove it when we boot; in /etc/rc.sysinit we remove /tmp/.X*unix on line 882; we also remove /tmp/.ICE-unix but recreate it correctly later on (line 887).  That would involve patching initscripts rather than gdm though.


Comment 16 Vincent Danen 2013-09-05 18:47:11 UTC

This flaw only affected GDM in Red Hat Enterprise Linux 5 and does not affect Red Hat Enterprise Linux 6.

Comment 17 errata-xmlrpc 2013-09-05 18:56:02 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2013:1213 https://rhn.redhat.com/errata/RHSA-2013-1213.html

Comment 18 Vincent Danen 2013-09-06 18:38:58 UTC
Created attachment 794934 [details]
patch for gdm

This is the patch to remove the bits that created /tmp/.X11-unix.

Comment 19 Vincent Danen 2013-09-06 18:39:55 UTC
Created attachment 794935 [details]
patch for initscripts

This is the patch to create /tmp/.X11-unix at boot.

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