X.Org Security Advisory: May 23, 2013

X.Org Security Advisory: May 23, 2013

Protocol handling issues in X Window System client libraries

Description

Ilja van Sprundel, a security researcher with IOActive, has discovered a large number of issues in the way various X client libraries handle the responses they receive from servers, and has worked with X.Org's security team to analyze, confirm, and fix these issues.

Most of these issues stem from the client libraries trusting the server to send correct protocol data, and not verifying that the values will not overflow or cause other damage. Most of the time X clients & servers are run by the same user, with the server more privileged from the clients, so this is not a problem, but there are scenarios in which a privileged client can be connected to an unprivileged server, for instance, connecting a setuid X client (such as a screen lock program) to a virtual X server (such as Xvfb or Xephyr) which the user has modified to return invalid data, potentially allowing the user to escalate their privileges.

The X.Org security team would like to take this opportunity to remind X client authors that current best practices suggest separating code that requires privileges from the GUI, to reduce the attack surface of issues like this.

The vulnerabilities include:

Affected Versions

X.Org believes all prior versions of these libraries contain these flaws, dating back to their introduction.

Versions of the X libraries built on top of the Xlib bridge to the XCB framework are vulnerable to fewer issues than those without, due to the added safety and consistency assertions in the XCB calls to read data from the network, but most of these vulnerabilities are not caught by those checks.

Fixes

Fixes are available in these git commits:

Note that many of these patches depend on being applied in the same order as they are in git, or on other non-CVE patches in git, and won't necessarily apply in the order listed here to previous tarball releases.

Fixes are also included in these module releases from X.Org:

or releases from our sister projects:

Thanks

X.Org thanks Ilja van Sprundel of IOActive for reporting these issues to our security team and assisting them in understanding them and evaluating our fixes, and Alan Coopersmith of Oracle for coordinating the X.Org response and developing the fixes for these issues.