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 Description ----------- 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. The fix is trivial, pass it an address where it expects one in difs/events.c: int ProcSetEventMask(ClientPtr client) { REQUEST(fsSetEventMaskReq); REQUEST_AT_LEAST_SIZE(fsSetEventMaskReq); 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; } Affected Versions ----------------- X11R6 through X11R6.6 appear to be vulnerable. The fix noted above 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 are not vulnerable. Workaround ---------- Disable the xfs font server on machines where it is not required and only older versions of the software are available. Fix --- Vendors still supporting xfs from a release prior to either X11R6.7 or XFree86 3.3.3 should apply the fix shown above, or upgrade to a non-vulnerable release. The X.Org Foundation thanks Rodrigo Rubira Branco (http://twitter.com/bsdaemon) 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.