[ANNOUNCE] X.Org Security Advisory: Multiple issues in libXfont

Alan Coopersmith alan.coopersmith at oracle.com
Tue May 13 08:08:12 PDT 2014

X.Org Security Advisory:  May 13, 2014
X Font Service Protocol & Font metadata file handling issues in libXfont


Ilja van Sprundel, a security researcher with IOActive, has discovered
several issues in the way the libXfont library handles the responses 
it receives from xfs servers, and has worked with X.Org's security team 
to analyze, confirm, and fix these issues.

Most of these issues stem from libXfont trusting the font server to send
valid protocol data, and not verifying that the values will not overflow 
or cause other damage.   This code is commonly called from the X server 
when an X Font Server is active in the font path, so may be running in a 
setuid-root process depending on the X server in use.  Exploits of this
path could be used by a local, authenticated user to attempt to raise
privileges; or by a remote attacker who can control the font server to
attempt to execute code with the privileges of the X server.  (CVE-2014-XXXA
is the exception, as it does not involve communication with a font server,
as explained below.)

The vulnerabilities are:

- CVE-2014-0209: integer overflow of allocations in font metadata file parsing

    When a local user who is already authenticated to the X server adds
    a new directory to the font path, the X server calls libXfont to open
    the fonts.dir and fonts.alias files in that directory and add entries
    to the font tables for every line in it.  A large file (~2-4 gb) could
    cause the allocations to overflow, and allow the remaining data read 
    from the file to overwrite other memory in the heap.

    Affected functions: FontFileAddEntry(), lexAlias()

- CVE-2014-0210: unvalidated length fields when parsing xfs protocol replies

    When parsing replies received from the font server, these calls do not
    check that the lengths and/or indexes returned by the font server are
    within the size of the reply or the bounds of the memory allocated to
    store the data, so could write past the bounds of allocated memory when
    storing the returned data.

    Affected functions: _fs_recv_conn_setup(), fs_read_open_font(),
    fs_read_query_info(), fs_read_extent_info(), fs_read_glyphs(),
    fs_read_list(), fs_read_list_info()

- CVE-2014-0211: integer overflows calculating memory needs for xfs replies

    These calls do not check that their calculations for how much memory
    is needed to handle the returned data have not overflowed, so can
    result in allocating too little memory and then writing the returned
    data past the end of the allocated buffer.

    Affected functions: fs_get_reply(), fs_alloc_glyphs(),

Affected Versions

X.Org believes all prior versions of this library contain these flaws,
dating back to its introduction in X11R5.


Fixes are available in the patches for these libXfont git commits:

Which are available now from:

Fixes will also be included in these module releases from X.Org:
      libXfont 1.4.8
      libXfont (1.5.0 RC 1)


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.

	-Alan Coopersmith-              alan.coopersmith at oracle.com
	  X.Org Security Response Team - xorg-security at lists.x.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-announce/attachments/20140513/0a2ee430/attachment.sig>

More information about the xorg-announce mailing list