Original issue date: May 7, 1997<BR>
Last revised: January 6, 1998<BR>
Updated URLs for Sun Microsystems, Inc.

<P>A complete revision history is at the end of this file.

<P>The CERT Coordination Center has received reports that a buffer overflow
condition exists in some implementations of xlock. This vulnerability makes
it possible for local users (users with access to an account on the system)
to execute arbitrary programs as a privileged user.

<P>Exploitation information involving this vulnerability has been made
publicly available.

<P>If your system is vulnerable, the CERT/CC team recommends installing
a patch from your vendor. If you are not certain whether your system is
vulnerable or if you know that your system is vulnerable and you cannot
add a patch immediately, we urge you to apply the workaround described
in Section III.B.

<P>We will update this advisory as we receive additional information. Please
check our advisory files regularly for updates that relate to your site.

<P><HR>
<H2>I. Description</H2>
xlock is a program that allows a user to "lock" an X terminal. A buffer
overflow condition exists in some implementations of xlock. It is possible
attain unauthorized access to a system by engineering a particular environment
and calling a vulnerable version of xlock that has setuid or setgid bits
set. Information about vulnerable versions must be obtained from vendors.
Some vendor information can be found in Appendix A of this advisory.

<P>Exploitation information involving this vulnerability has been made
publicly available.

<P>Note that this problem is different from that discussed in CERT Advisory
<A HREF="http://www.cert.org/advisories/CA-97.11.libXt.html">CA-97.11.libXt</A>.
<BR>
<H2>II. Impact</H2>
Local users are able to execute arbitrary programs as a privileged user
without authorization.
<BR>
<H2>III. Solution</H2>
Install a patch from your vendor as described in Solution A. If you are
not certain whether your system is vulnerable or if you know that your
system is vulnerable and you cannot install a patch immediately, we recommend
Solution B.
<H3>A. Obtain and install a patch for this problem.</H3>
Below is a list of vendors who have provided information about xlock. Details
are in Appendix A of this advisory; we will update the appendix as we receive
more information. If your vendor's name is not on this list, the CERT/CC
did not hear from that vendor. Please contact your vendor directly.

<P>Berkeley Software Design, Inc. (BSDI)
<BR>Cray Research - A Silicon Graphics Company
<BR>Data General Corporation
<BR>Digital Equipment Corporation
<BR>FreeBSD, Inc.
<BR>Hewlett-Packard Company
<BR>IBM Corporation
<BR>LINUX
<BR>NEC Corporation
<BR>The Open Group [This group distributes the publicly available software
that was formerly distributed by X Consortium]
<BR>Silicon Graphics Inc. (SGI)
<BR>Solbourne
<BR>Sun Microsystems, Inc.
<BR>
<H3>B. We recommend the following workaround if you are not certain whether your system is vulnerable or if you know that your system is vulnerable and you cannot install a patch immediately.</H3>

<P>1. Find and disable any copies of xlock that exist on your system and that
have the setuid or setgid bits set.</P>

<P>2. Install a version of xlock known to be immune to this vulnerability.</P>
One such supported tool is xlockmore. The latest version of this tool is
4.02, and you should ensure that this is the version you are using. This
utility can be obtained from the following site:

<P><A HREF="ftp://ftp.x.org/contrib/applications/xlockmore-4.02.tar.gz">ftp://ftp.x.org/contrib/applications/xlockmore-4.02.tar.gz</A>
<BR>MD5 (xlockmore-4.02.tar.gz) = c158e6b4b99b3cff4b52b39219dbfe0e

<P>You can also obtain this version from mirror sites. A list of these
sites will be displayed if you are not able to access the above archive
due to load.

<P><HR>
<H2>Appendix A - Vendor Information</H2>
Below is a list of the vendors who have provided information for this advisory.
We will update this appendix as we receive additional information. If you
do not see your vendor's name, the CERT/CC did not hear from that vendor.
Please contact the vendor directly.
<H3>Berkeley Software Design, Inc. (BSDI)</H3>
BSD/OS 2.1 is vulnerable to the xlock vulnerability. BSDI recommends that
2.1 customers either upgrade to BSD/OS 3.0 or remove the setuid permission
from /usr/X11/bin/xlock.
<H3>Cray Research - A Silicon Graphics Company</H3>
Cray Research does not include xlock in its X Window releases, so we are
not at risk on the xlock buffer overflow problem.
<H3>Data General Corporation</H3>
The xlock sources (xlockmore-3.7) that DG includes in its contributed software
package have been modified to remove this vulnerability. These will be
available when release 8 comes out. We also recommend that our customers
who have the current version should change the sprintf calls in resource.c
to snprintf calls, rebuild and reinstall the package.
<H3>Digital Equipment Corporation</H3>
This reported problem is not present for Digital's ULTRIX or Digital UNIX
Operating Systems Software.
<H3>FreeBSD, Inc.</H3>
The xlockmore version we ship in our ports collection is vulnerable in
all shipped releases. The port in FreeBSD-current is fixed. Solution is
to install the latest xlockmore version (4.02).
<H3>Hewlett-Packard Company</H3>
We ship an suid root program vuelock that is based on xlock. It does have
the vulnerability.

<P>The only workaround is to remove the executable, the patch is "in process".
<H3>IBM Corporation</H3>
AIX is vulnerable to the conditions described in this advisory. The following
APARs will be released soon:

<P>AIX 3.2 : APAR IX68189
<BR>AIX 4.1 : APAR IX68190
<BR>AIX 4.2 : APAR IX68191

<P>IBM and AIX are registered trademarks of International Business Machines
Corporation.
<H3>LINUX</H3>
Red Hat:
<BR>Not vulnerable

<P>Caldera:
<BR>Not vulnerable

<P>Debian:
<BR>An updated package is on the Debian site

<P>SuSE:

<P><A HREF="ftp://ftp.suse.com/pub/SuSE-Linux/suse_update/S.u.S.E.-4.4.1/xap1/xlock">ftp://ftp.suse.com/pub/SuSE-Linux/suse_update/S.u.S.E.-4.4.1/xap1/xlock</A>

<P>And in general the new Xlockmore release fixes the problems.
<H3>NEC Corporation</H3>

<TABLE BORDER=0 COLS=2 WIDTH="100%" NOSAVE >
<TR>
<TD>UX/4800</TD>

<TD>Not vulnerable for all versions.</TD>
</TR>

<TR>
<TD>EWS-UX/V(Rel4.2MP</TD>

<TD>Not vulnerable for all versions.</TD>
</TR>

<TR>
<TD>EWS-UX/V(Rel4.2)</TD>

<TD>Not vulnerable for all versions.</TD>
</TR>

<TR>
<TD>UP-UX/V(Rel4.2MP)</TD>

<TD>Not vulnerable for all versions.</TD>
</TR>
</TABLE>

<H3>The Open Group</H3>
Publicly available software that was formerly distributed by the X Consortium
-
<BR>Not vulnerable.
<H3>Silicon Graphics Inc. (SGI)</H3>
Patch information can be found in SGI advisory 19970502-02-PX, available
from <A HREF="ftp://sgigate.sgi.com/security/">ftp://sgigate.sgi.com/security/</A>
<H3>Solbourne</H3>
Solbourne is not vulnerable to this attack.
<H3>Sun Microsystems, Inc.</H3>
Bulletin Number: #00150
<BR>Date: August 12, 1997
<BR>Title: Vulnerability in xlock
<BR>Vulnerable: SunOS versions 5.5.1, 5.5.1_x86, 5.5, 5.5_x86, 5.4, 5.4_x86,
5.3, 4.1.4, and 4.1.3_U1

<P>The vulnerability is fixed in the upcoming release of Solaris.

<P>Patches are available to all Sun customers via World Wide Web at:
<BR><A HREF="ftp://sunsolve.sun.com/pub/patches/">ftp://sunsolve.sun.com/pub/patches.html</A>

<P>Customers with Sun support contracts can also obtain patches from local
Sun answer centers and SunSITEs worldwide.

<P>Sun security bulletins are available via World Wide Web at:<A HREF="http://sunsolve1.sun.com/sunsolve/secbulletins>"></A>

<P><A HREF="http://sunsolve.Sun.COM/pub-cgi/us/secbul.pl">http://sunsolve.Sun.COM/pub-cgi/us/secbul.pl</A>

<P><HR>
<BR>The CERT Coordination Center thanks David Hedley for reporting the
original problem and Kaleb Keithley at The Open Group for his support in
the development of this advisory.

<P><HR>

<!--#include virtual="/include/footer_nocopyright.html" -->
<P>Copyright 1997 Carnegie Mellon University.</P>

<HR>

Revision History
<PRE>
Jan. 06, 1999   Updated URLs for Sun Microsystems, Inc.
Sep. 30, 1997	Updated copyright statement
Aug. 15, 1997   Appendix A - updated information for Sun Microsystems, Inc.
July 21, 1997   Appendix A - added information for SGI.
June 4, 1997    Appendix A - updated vendor information for BSDI.
</PRE>