NetBSD Security Advisory 2013-007: Protocol handling issues in X Window System client libraries

NetBSD Security Officer <[email protected]>
Newsgroups gmane.os.netbsd.devel.security
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

		NetBSD Security Advisory 2013-007
		=================================

Topic:		Protocol handling issues in X Window System client libraries


Version:	NetBSD-current:		source prior to Jun 6th, 2013
		NetBSD 6.1:		affected
		NetBSD 6.0:		affected
		NetBSD 5.1:		affected
		NetBSD 5.2:		affected

Severity:	Privilege Escalation

Fixed:		NetBSD-current:		Jun 6th, 2013
		NetBSD-6-0 branch:	Jun 6th, 2013
		NetBSD-6-1 branch:	Jun 6th, 2013
		NetBSD-6 branch:	Jun 6th, 2013
		NetBSD-5-2 branch:	Jun 6th, 2013
		NetBSD-5-1 branch:	Jun 6th, 2013
		NetBSD-5 branch:	Jun 6th, 2013

Please note that NetBSD releases prior to 5.1 are no longer supported.
It is recommended that all users upgrade to a supported release.


Abstract
========

X Window System client libraries were trusting server input to be
correct and non-malicious. In case of a client displaying to a server
under different administration, that trust may be unfounded.

This set of vulnerabilities has been assigned the following CVE ids:
CVE-2013-1981 CVE-2013-1982 CVE-2013-1983 CVE-2013-1984 CVE-2013-1985
CVE-2013-2062 CVE-2013-1986 CVE-2013-1987 CVE-2013-1988 CVE-2013-2063
CVE-2013-1989 CVE-2013-1990 CVE-2013-1991 CVE-2013-1992 CVE-2013-2064
CVE-2013-1993 CVE-2013-1994 CVE-2013-1995 CVE-2013-1996 CVE-2013-1997
CVE-2013-1998 CVE-2013-2066 CVE-2013-1999 CVE-2013-2000 CVE-2013-2001
CVE-2013-2002 CVE-2013-1981 CVE-2013-2003 CVE-2013-2004 CVE-2013-2005


Technical Details
=================

See http://www.x.org/wiki/Development/Security/Advisory-2013-05-23
for details.

The bugs fall into 6 general areas:

 - Integer overflow errors in memory allocation.
 - Signed extension errors in memory allocation.
 - Buffer overflows due to unvalidated data.
 - Integer overflows in parsing user data.
 - Infinte recursion in user data.
 - Memory corruption due to uninitialised pointer use.


Scenarios for the privilege escalation are an attacker displaying
an s-bitted client (eg a xlock variant) on a malicious server under
their control, or using e.g. one of the buffer overflow varieties
to execute code as root.



Solutions and Workarounds
=========================

Binary:
Install a new xbase set. These can be found pre-compiled at
http://nyftp.netbsd.org/pub/NetBSD-daily/<netbsd-branch>/<datetime>Z/<arch>/binary/sets/xbase.tgz

- From source:
For NetBSD-current, update to version 2013-06-06 or newer.

For NetBSD releases, update the following files to at least
the version given:

File Name
  netbsd-5-1   netbsd-5-2   netbsd-5
    netbsd-6-0    netbsd-6-1    netbsd-6
=========================================================
xsrc/external/mit/MesaLib/dist/src/glx/x11/XF86dri.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.1.4.1    1.1.1.1.6.1    1.1.1.1.2.1
xsrc/external/mit/libFS/dist/src/FSOpenServ.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.2.4.1    1.1.1.2.6.1    1.1.1.2.2.1
xsrc/external/mit/libX11/dist/modules/im/ximcp/imLcPrs.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.5.4.1    1.1.1.5.6.1    1.1.1.5.2.1
xsrc/external/mit/libX11/dist/modules/im/ximcp/imTrX.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.6.4.1    1.1.1.6.6.1    1.1.1.6.2.1
xsrc/external/mit/libX11/dist/src/AllCells.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libX11/dist/src/Font.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.5.4.1    1.1.1.5.6.1    1.1.1.5.2.1 
xsrc/external/mit/libX11/dist/src/FontInfo.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/FontNames.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/GetFPath.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libX11/dist/src/GetImage.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/GetMoEv.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/GetPntMap.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/GetProp.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.5.4.1    1.1.1.5.6.1    1.1.1.5.2.1
xsrc/external/mit/libX11/dist/src/LiHosts.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/ListExt.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libX11/dist/src/ModMap.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/Xrm.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.6.4.1    1.1.1.6.6.1    1.1.1.6.2.1
xsrc/external/mit/libX11/dist/src/xcms/cmsColNm.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/xkb/XKBExtDev.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/xkb/XKBGeom.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.5.4.1    1.1.1.5.6.1    1.1.1.5.2.1 
xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libXcursor/dist/src/file.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXext/dist/src/XEVI.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXext/dist/src/XShape.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXext/dist/src/XSync.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.2.4.1    1.2.6.1    1.2.2.1
xsrc/external/mit/libXext/dist/src/Xcup.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXext/dist/src/Xdbe.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libXfixes/dist/src/Cursor.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libXi/dist/src/XGMotion.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXi/dist/src/XGetBMap.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.2.4.1    1.1.1.2.6.1    1.1.1.2.2.1
xsrc/external/mit/libXi/dist/src/XGetDCtl.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libXi/dist/src/XGetDProp.c
  1.1.1.1.2.2.2.1    1.1.1.1.2.2.4.1    1.1.1.1.2.3
    1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.4.1
xsrc/external/mit/libXi/dist/src/XGetFCtl.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXi/dist/src/XGetProp.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.2.4.1    1.1.1.2.6.1    1.1.1.2.2.1
xsrc/external/mit/libXi/dist/src/XListDev.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXi/dist/src/XQueryDv.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXinerama/dist/src/Xinerama.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXrandr/dist/src/XrrProperty.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXrender/dist/src/Filter.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXrender/dist/src/Xrender.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.2.4.1    1.1.1.2.6.1    1.1.1.2.2.1
xsrc/external/mit/libXres/dist/src/XRes.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXt/dist/src/ResConfig.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libXt/dist/src/Selection.c
  1.1.1.1.2.1.2.1    1.1.1.1.2.1.4.1    1.1.1.1.2.2
    1.1.1.5.4.1    1.1.1.5.6.1    1.1.1.5.2.1 
xsrc/external/mit/libXv/dist/src/Xv.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.2.4.1    1.1.1.2.6.1    1.1.1.2.2.1
xsrc/external/mit/libXvMC/dist/src/XvMC.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.2.4.1    1.1.1.2.6.1    1.1.1.2.2.1
xsrc/external/mit/libXxf86dga/dist/src/XF86DGA2.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXxf86vm/dist/src/XF86VMode.c
  1.1.1.1.6.1    1.1.1.1.8.1    1.1.1.1.2.1
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1

src/external/mit/xorg/lib/libX11/Makefile.libx11
  1.5.2.1.2.1    1.5.2.1.6.1    1.5.2.2
    1.8.10.1    1.8.12.1    1.8.6.1
src/external/mit/xorg/lib/libXi/Makefile
  1.3.6.1.2.1    1.3.6.1.6.1    1.3.6.2
    1.8.10.1    1.8.16.1    1.8.4.1

Only in netbsd-5 branches:
src/external/mit/xorg/lib/fontconfig/src/Makefile
  1.4.4.1.2.1    1.4.4.1.6.1    1.4.4.2

Only in netbsd-6 branches:
xsrc/external/mit/libX11/dist/modules/im/ximcp/Makefile.am
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libXi/dist/src/XIPassiveGrab.c
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXi/dist/src/XIProperties.c
    1.1.1.3.4.1    1.1.1.3.6.1    1.1.1.3.2.1
xsrc/external/mit/libXi/dist/src/XISelEv.c
    1.1.1.4.4.1    1.1.1.4.6.1    1.1.1.4.2.1
xsrc/external/mit/libxcb/dist/src/xcb_in.c
    1.1.1.2.4.1    1.1.1.2.6.1    1.1.1.2.2.1
xsrc/external/mit/xf86-video-openchrome/dist/libxvmc/xf86dri.c
    1.1.1.1.4.1    1.1.1.1.6.1    1.1.1.1.2.1

Then use build.sh -x from src to rebuild the system including X.


Thanks To
=========

Thanks to Ilja van Sprundel of IOActive (reporter to X.Org),
Alan Coopersmith of Oracle (X.Org coordinator and fixer),
matthew green for handling the necessary updates in NetBSD.


Revision History
================

	2013-07-30	Initial release


More Information
================

Advisories may be updated as new information becomes available.
The most recent version of this advisory (PGP signed) can be found at 
  http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2013-007.txt.asc

Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.org/ and http://www.NetBSD.org/Security/ .


Copyright 2013, The NetBSD Foundation, Inc.  All Rights Reserved.
Redistribution permitted only in full, unmodified form.

$NetBSD: NetBSD-SA2013-007.txt,v 1.1 2013/07/30 20:43:23 tonnerre Exp $

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJR+CYKAAoJEAZJc6xMSnBu0UgQAMtzf8/bbm8QnFhyAFyvrFuW
vfP6VmezWB9PuqX4C2psHx/b4K3aq5wpJhlu9xJi+dwBa7NyXnuFjkoC7iT7fhzO
FA3AFxau6rIDTLpW7klHKFWAjrMQbGb3GajpDqpQtDcoSBosDqsPCMs0s3vS60bx
5NM7eUmZEY2l5u8ofQw//joH2yxbRlBnC+aTe6JMBosdf7flpeNhqYjr7u0DPxIJ
fgQ3MwFFhXs6J1oTvdn78Qgwt0iqzfoDe7YLwIyLppbo8pVwXSBHAXDebewyyKmS
BUH99WTnHQGiAwvv6wcs0FbaK1EJst3ZtG+QAXdRQtRsZ/peNmPOGKf19rftp0YA
xApvanIvWYrWP8Jv0k0DcrFrI1lmIzvYo4P1sXGspvoV6K4tNB250h38JCw2bB/n
KtWCJhArXiibqr3+Qkiqe8PgitgxqwO8UYw0jc2ExQcGUvDFjjWH8q4rwg3DXKHO
kO52AJJIF3dCF9aGezm40SGJ1DBtdUwJ0R+NGmQQb7NKYGc/LNAXmnOAUHgxzJKf
AyG71v1MNHNnhjis4cvXOTfVyFz3c/FVLCY4TXDLlaWTy3Vf6nQiJUvaqwnzGy60
6Ld/9u+y7Vtnxgzi4/ATNPRn2CHobwfjRvd5dliexo6CKmUNn8hHbyHVOeYECkAQ
DRL0SU5eOdmu+Gj+hsQS
=kv5u
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.