Alan Coopersmith | 24 Jul 17:31 2012

X.Org security advisory: DoS/info leak in xfs prior to X11R6.7/XFree86 3.3.3

X.Org security advisory, July 24, 2012
Denial of Service & Information leak in xfs prior to X11R6.7/XFree86 3.3.3
CVE IDs: CVE-2012-1699


A vulnerability has been found in the X11R6 font server code in the
handling of the SetEventMask request in xfs - if an invalid mask is
specified, it passes that bad mask to the SendErrToClient() function
for returning to the client in the error message.  Unfortunately,
SendErrToClient() expects a pointer, but was being passed the raw
mask value, causing it to use the mask as a pointer, either segfaulting
(if that happened to be an invalid pointer), or returning whatever data
happened to be accessible in the 4 bytes at the address specified by
the mask value.

Affected Versions

X11R6 through X11R6.6 appear to be vulnerable.   The fix shown below was
introduced by XFree86 in their 3.3.3 release as part of the commit for:
   Prototype/ansification cleanup for Xserver/XIE, xfs, fontlib, mkfontdir,
   and fix some bugs found along the way (#2103, Thomas Dickey).

X11R6.7 incorporated the XFree86 changes, and thus X11R6.7 and later releases
from X.Org are not vulnerable.


Disable the xfs font server on machines where it is not required and only
older versions of the software are available.


Vendors still supporting xfs from a release prior to either X11R6.7
or XFree86 3.3.3 should upgrade to a non-vulnerable release if possible.
If upgrade is not possible, the fix is trivial, pass an address where one
is expected in difs/events.c:

 ProcSetEventMask(ClientPtr client)

     if (stuff->event_mask & ~AllEventMasks) {
      SendErrToClient(client, FSBadEventMask, (pointer) stuff->event_mask);
+       SendErrToClient(client, FSBadEventMask, (pointer) &stuff->event_mask);
        return FSBadEventMask;
     client->eventmask = stuff->event_mask;
     return client->noClientException;


The X.Org Foundation thanks Rodrigo Rubira Branco (
from the Qualys Vulnerability & Malware Research Labs (VMRL) for bringing
this issue to Oracle's attention, and Oracle for notifying X.Org once the
issue was found to be in the common (though older) code base.

The X.Org Foundation also thanks Thomas Dickey & the XFree86 Project for
providing a fix that has protected our users since the integration of the
XFree86 code base into X11R6.7.