copyright | disclaimer | privacy | contact  
Australia's Leading Computer Emergency Response Team
 
Search this site

 
On this site

 > HOME
 > About AusCERT
 > Membership
 > Contact Us
 > PKI Services
 > Training
 > Publications
 > Sec. Bulletins
 > Conferences
 > News & Media
 > Services
 > Web Log
 > Site Map
 > Site Help
 > Member login





 

AA-97.24 -- SGI IRIX xlock Buffer Overrun Vulnerability

Date: 01 August 1997

Click here for printable version
Click here for PGP verifiable version
-----BEGIN PGP SIGNED MESSAGE-----

===========================================================================
AA-97.24                        AUSCERT Advisory
                   SGI IRIX xlock Buffer Overrun Vulnerability
                                 29 May 1997

Last Revised: 	--  01 August 1997

                    Added SGI Security Advisory in Appendix A.
		    Changed Section 3 to include vendor patch information.

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

- ---------------------------------------------------------------------------

AUSCERT has received information that a vulnerability exists in xlock(1),
distributed under IRIX 6.2.  Other versions of IRIX may also be vulnerable.

This vulnerability may allow local users to gain root privileges.

Exploit information involving this vulnerability has been made publicly
available.

Vendor patches have been released addressing this vulnerability.

AUSCERT recommends that sites take the steps outlined in section 3 as soon
as possible.

This advisory will be updated as more information becomes available.

- ---------------------------------------------------------------------------

1.  Description

    xlock(1) is a program that locks the local X display until a password
    is entered.

    Due to insufficient bounds checking on arguments which are supplied
    by users, it is possible to overwrite the internal stack space of the
    xlock program while it is executing.  By supplying a carefully designed
    argument to the xlock program, intruders may be able to force xlock
    to execute arbitrary commands.  As xlock is setuid root, this may
    allow intruders to run arbitrary commands with root privileges.

    Sites can determine if this program is installed by using:

	% ls -l /usr/bin/X11/xlock

    xlock is installed by default in /usr/bin/X11.  Sites are encouraged
    to check for the presence of this program regardless of the version
    of IRIX installed.

    Exploit information involving this vulnerability has been made publicly
    available.

2.  Impact

    This vulnerability may allow local users to gain root privileges.

3.  Workarounds/Solution

    Official vendor patches have been released by Silicon Graphics which
    address this vulnerability (Section 3.3).

    If the patches recommended by Silicon Graphics cannot be applied,
    AUSCERT recommends that sites prevent the exploitation of this
    vulnerability by immediately applying the workaround given in Section
    3.1.  To maintain the functionality of xlock, AUSCERT recommends
    applying the workaround given in Section 3.2.

3.1 Remove setuid and non-root execute permissions

    To prevent the exploitation of the vulnerability described in this
    advisory, AUSCERT recommends that the setuid permissions be removed
    from the xlock program immediately.  As xlock will no longer work for
    non-root users, it is recommended that the execute permissions for
    them also be removed.

	# ls -l /usr/bin/X11/xlock
	-rwsr-xr-x    1 root     sys    95188 Nov 28  1996 /usr/bin/X11/xlock

	# chmod 500 /usr/bin/X11/xlock
	# ls -l /usr/bin/X11/xlock
	-r-x------    1 root     sys    95188 Nov 28  1996 /usr/bin/X11/xlock

3.2 Install wrapper

    AUSCERT has developed a wrapper to help prevent programs from being
    exploited using the vulnerability described in this advisory.  Sites
    which have a C compiler can obtain the source, compile and install
    the wrapper.  Please contact AUSCERT directly if pre-compiled wrapper
    binaries are required.

    The source for the wrapper, including installation instructions, can
    be found at:

	ftp://ftp.auscert.org.au/pub/auscert/tools/overflow_wrapper/
						overflow_wrapper.c

    This wrapper replaces the xlock program and checks the length of the
    command line arguments which are passed to it.  If an argument exceeds
    a certain predefined value (MAXARGLEN), the wrapper exits without
    executing the xlock command.  The wrapper program can also be
    configured to syslog any failed attempts to execute xlock with
    arguments exceeding MAXARGLEN.  For further instructions on using this
    wrapper, please read the comments at the top of overflow_wrapper.c.

    When compiling overflow_wrapper.c for use with xlock, AUSCERT
    recommends defining MAXARGLEN to be 32.

    The MD5 checksum for the current version of overflow_wrapper.c can be
    retrieved from:

	ftp://ftp.auscert.org.au/pub/auscert/tools/overflow_wrapper/CHECKSUM

    The CHECKSUM file has been digitally signed using the AUSCERT PGP key.

3.3 Install vendor patches

    Silicon Graphics has released patches which address the vulnerability
    described in this advisory.  AUSCERT recommends that sites apply theses
    patches as soon as possible.

    Operating System      Vulnerable?     Patch #
    ~~~~~~~~~~~~~~~~      ~~~~~~~~~~~     ~~~~~~~

    IRIX 3.x              no
    IRIX 4.x              no
    IRIX 5.0.x            yes             not avail
    IRIX 5.1.x            yes             not avail
    IRIX 5.2              yes             not avail
    IRIX 5.3              yes             2090
    IRIX 6.0.x            yes             not avail
    IRIX 6.1              yes             not avail
    IRIX 6.2              yes             2090
    IRIX 6.3              yes             2090
    IRIX 6.4              yes             2091

    These patches can be retrieved from:

	http://www.sgi.com/Support/Secur/security.html

    Silicon Graphics has also released a security bulletin containing
    information on the above patches. The original release of this bulletin
    has been appended in Appendix A.

4.  Additional measures

    Most Unix systems ship with numerous programs which have setuid or
    setgid privileges.  Often the functionality supplied by these privileged
    programs is not required by many sites.  The large number of privileged
    programs that are shipped by default are to cater for all possible
    uses of the system.

    AUSCERT encourages sites to examine all the setuid/setgid programs
    and determine the necessity of each program.  If a program does not
    absolutely require the setuid/setgid privileges to operate (for example,
    it is only run by the root user),  the setuid/setgid privileges should
    be removed.  Furthermore, if a program is not required at your site,
    then all execute permissions should be removed.

    A sample command to find all setuid/setgid programs is (run as root):

       # find / ( -perm -4000 -o -perm -2000 ) -type f -exec ls -l {} ;

    It is AUSCERT's experience that many vulnerabilities are being discovered
    in setuid/setgid programs which are not necessary for the correct
    operation of most systems.  Sites can increase their security by
    removing unnecessary setuid/setgid programs.

    For example, the functionality provided by the xlock program is not
    needed by many sites.  If sites had previously disabled this program,
    they would not have been susceptible to this latest vulnerability.

.........................................................................
Appendix A

- ----------------------- BEGIN SGI SECURITY ADVISORY ----------------------

- - -----BEGIN PGP SIGNED MESSAGE-----

______________________________________________________________________________
                Silicon Graphics Inc. Security Advisory

        Title:   xlock Vulnerability
        Number:  19970502-02-PX
        Date:    July 7, 1997
______________________________________________________________________________

Silicon Graphics provides this information freely to the SGI user community
for its consideration, interpretation, implementation and use.   Silicon
Graphics recommends that this information be acted upon as soon as possible.

Silicon Graphics provides the information in this Security Advisory on
an "AS-IS" basis only, and disclaims all warranties with respect thereto,
express, implied or otherwise, including, without limitation, any warranty
of merchantability or fitness for a particular purpose.  In no event shall
Silicon Graphics be liable for any loss of profits, loss of business, loss
of data or for any indirect, special, exemplary, incidental or consequential
damages of any kind arising from your use of, failure to use or improper
use of any of the instructions or information in this Security Advisory.
______________________________________________________________________________

- - - -----------------------
- - - --- Issue Specifics ---
- - - -----------------------

The xlock(1) program is used to lock the local X display of a system
until a correct password is entered at the keyboard.  The program is
setuid root and as part of the process of locking an X display accepts
user arguments to establish specific xlock operation.

It has been determined that an appropriately crafted set of arguments
could be input to the xlock program allowing execution of arbitrary
user commands with root privileges.   This resulting buffer overflow
condition is considered a security vulnerability in the xlock program.

Silicon Graphics Inc. has investigated the issue and recommends the
following steps for neutralizing the exposure.  It is HIGHLY RECOMMENDED
that these measures be implemented on ALL SGI systems.  This issue will
be corrected in future releases of IRIX.


- - - --------------
- - - --- Impact ---
- - - --------------

The xlock program (/usr/bin/X11/xlock) is installed on all IRIX systems
by default.

A local account is required in order to exploit this vulnerability both
locally and remotely.

This vulnerability can be utilized to execute commands with root
privileges.

This vulnerability has been publically discussed and reported in
CERT advisory CA-97.13 and AUSCERT advisory AA-97.24.



- - - --------------------------
- - - --- Temporary Solution ---
- - - --------------------------

Although patches are available for this issue, it is realized that
there may be situations where installing the patches immediately may
not be possible.

The steps below can be used to remove the vulnerability by removing
the permissions of the xlock program.



     1) Become the root user on the system.

                % /bin/su -
                Password:
                #

     2) Change the permissions on the xlock program.


                # /bin/chmod 500 /usr/bin/X11/xlock


                           ************
                           *** NOTE ***
                           ************

               Removing the setuid root permissions from the xlock
               program will prevent non-root users from using the xlock
               to lock their terminal.

     3) Return to previous level.

                # exit
                $



- - - ----------------
- - - --- Solution ---
- - - ----------------



   OS Version     Vulnerable?     Patch #      Other Actions
   ----------     -----------     -------      -------------

   IRIX 3.x          no
   IRIX 4.x          no
   IRIX 5.0.x        yes          not avail    Note 1
   IRIX 5.1.x        yes          not avail    Note 1
   IRIX 5.2          yes          not avail    Note 1
   IRIX 5.3          yes          2090
   IRIX 6.0.x        yes          not avail    Note 1
   IRIX 6.1          yes          not avail    Note 1
   IRIX 6.2          yes          2090
   IRIX 6.3          yes          2090
   IRIX 6.4          yes          2091


   NOTES

     1) upgrade operating system or see "Temporary Solution" section.



Patches are available via anonymous FTP and your service/support provider.

The SGI anonymous FTP site is sgigate.sgi.com (204.94.209.1) or its
mirror, ftp.sgi.com.   Security information and patches can be found
in the ~ftp/security and ~ftp/patches directories, respectfully.



                 ##### Patch File Checksums ####

The actual patch will be a tar file containing the following files:



Filename:                 README.patch.2090
Algorithm #1 (sum -r):    50124 8 README.patch.2090
Algorithm #2 (sum):       49453 8 README.patch.2090
MD5 checksum:             4D51EA09250113215760C045BE8F5E14

Filename:                 patchSG0002090
Algorithm #1 (sum -r):    49562 1 patchSG0002090
Algorithm #2 (sum):       25201 1 patchSG0002090
MD5 checksum:             99F72D8E24773A63306A0118F56411E7

Filename:                 patchSG0002090.idb
Algorithm #1 (sum -r):    47573 1 patchSG0002090.idb
Algorithm #2 (sum):       35831 1 patchSG0002090.idb
MD5 checksum:             9E16916C33EA81D2C090A9162FB7B099

Filename:                 patchSG0002090.x_eoe_sw
Algorithm #1 (sum -r):    40887 114 patchSG0002090.x_eoe_sw
Algorithm #2 (sum):       62640 114 patchSG0002090.x_eoe_sw
MD5 checksum:             7088ECF05104E049DCC1D5150EE41F8C



Filename:                 README.patch.2091
Algorithm #1 (sum -r):    08547 8 README.patch.2091
Algorithm #2 (sum):       35395 8 README.patch.2091
MD5 checksum:             54836F64E12DDBAE09E1F165B42A7B01

Filename:                 patchSG0002091
Algorithm #1 (sum -r):    50655 1 patchSG0002091
Algorithm #2 (sum):       27369 1 patchSG0002091
MD5 checksum:             857AE0806FE273DB75F99264873828FD

Filename:                 patchSG0002091.idb
Algorithm #1 (sum -r):    07183 1 patchSG0002091.idb
Algorithm #2 (sum):       35505 1 patchSG0002091.idb
MD5 checksum:             134D7A6DC774425B6CC73A84A9468833

Filename:                 patchSG0002091.x_eoe_sw
Algorithm #1 (sum -r):    23378 102 patchSG0002091.x_eoe_sw
Algorithm #2 (sum):       26001 102 patchSG0002091.x_eoe_sw
MD5 checksum:             1FF45DAC2F7FDCCAB8A982ED77554DDA




- - - ------------------------
- - - --- Acknowledgments ---
- - - ------------------------

Silicon Graphics Inc. wishes to thank the CERT Coordination Center
and AUSCERT for their assistance in this issue.



- - - -----------------------------------------------------------
- - - --- Silicon Graphics Inc. Security Information/Contacts ---
- - - -----------------------------------------------------------

If there are questions about this document, email can be sent to
cse-security-alert@sgi.com.

                      ------oOo------

Silicon Graphics provides security information and patches for
use by the entire SGI community.  This information is freely
available to any person needing the information and is available
via anonymous FTP and the Web.

The primary SGI anonymous FTP site for security information and patches
is sgigate.sgi.com (204.94.209.1).  Security information and patches
are located under the directories ~ftp/security and ~ftp/patches,
respectively. The Silicon Graphics Security Headquarters Web page is
accessible at the URL http://www.sgi.com/Support/Secur/security.html.

For issues with the patches on the FTP sites, email can be sent to
cse-security-alert@sgi.com.

For assistance obtaining or working with security patches, please
contact your SGI support provider.

                      ------oOo------

Silicon Graphics provides a free security mailing list service
called wiretap and encourages interested parties to self-subscribe
to receive (via email) all SGI Security Advisories when they are
released. Subscribing to the mailing list can be done via the Web
(http://www.sgi.com/Support/Secur/wiretap.html) or by sending email
to SGI as outlined below.

% mail wiretap-request@sgi.com
subscribe wiretap <YourEmailAddress>
end
^d

In the example above, <YourEmailAddress> is the email address that you
wish the mailing list information sent to.  The word end must be on a
separate line to indicate the end of the body of the message. The
control-d (^d) is used to indicate to the mail program that you are
finished composing the mail message.


                      ------oOo------

Silicon Graphics provides a comprehensive customer World Wide Web site.
This site is located at http://www.sgi.com/Support/Secur/security.html.

                      ------oOo------

For reporting *NEW* SGI security issues, email can be sent to
security-alert@sgi.com or contact your SGI support provider.  A
support contract is not required for submitting a security report.

______________________________________________________________________________
  This information is provided freely to all interested parties and may
  be redistributed provided that it is not altered in any way, Silicon
  Graphics is appropriately credited and the document retains and
  includes its valid PGP signature.


- - -----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBM8FvdLQ4cFApAP75AQFUeQQAkSGeKlM8xVnrnkxffodmCYKm5DP5SGCU
mfRiIvi9i2tuuzOGNNDGo7d5DE2xhL+40yfoNUTNBvCpj5Oz5KHUyWU93kfQGB3c
f3JgsEcc8s888cOqTRenqhqP6Ey0+tjJItsRC5oo+hharJTAcmTBh9BRBHm5I5UL
ngmPNnHE3pE=
=rLt0
- - -----END PGP SIGNATURE-----

- ----------------------- END SGI SECURITY ADVISORY --------------------------
...........................................................................

- ---------------------------------------------------------------------------

The AUSCERT team have made every effort to ensure that the information
contained in this document is accurate.  However, the decision to use the
information described is the responsibility of each user or organisation.
The appropriateness of this document for an organisation or individual
system should be considered before application in conjunction with local
policies and procedures.  AUSCERT takes no responsibility for the
consequences of applying the contents of this document.

If you believe that your system has been compromised, contact AUSCERT or
your representative in FIRST (Forum of Incident Response and Security
Teams).

AUSCERT is located at The University of Queensland within the Prentice
Centre.  AUSCERT is a full member of the Forum of Incident Response and
Security Teams (FIRST).

AUSCERT maintains an anonymous FTP service which is found on:
ftp://ftp.auscert.org.au/pub/.  This archive contains past SERT and AUSCERT
Advisories, and other computer security information.

AUSCERT also maintains a World Wide Web service which is found on:
http://www.auscert.org.au/.

Internet Email: auscert@auscert.org.au
Facsimile:	(07) 3365 4477
Telephone:	(07) 3365 4417 (International: +61 7 3365 4417)
		AUSCERT personnel answer during Queensland business hours
		which are GMT+10:00 (AEST).
		On call after hours for emergencies.

Postal:
Australian Computer Emergency Response Team
Prentice Centre
Brisbane
Qld.  4072.
AUSTRALIA

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Revision History

01 Aug, 1997    Silicon Graphics has released a security advisory
                addressing the vulnerability described in this advisory.
		This has been appended in Appendix A. Section 3 has been
		modified to include this information.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: ftp://ftp.auscert.org.au/pub/auscert/AUSCERT_PGP.key

iQCVAwUBM+H+TSh9+71yA2DNAQHaIwP+PH89h6VmjaXpc7Utxj5KTzt4EE1bSHnw
EwgzabNFw53xJutlFD5uXUvxglrNa9h0Ftn7ZWybaOZQ+dNg8hoxCjcHZ/7fS5lW
t0J+irzWn+R7WAQUn/aB4JRXar4oNhKzN6Rqq/ogAg+yhVtOxb/GqPfZnx0vjsVn
lKQ8XgfvAF4=
=djix
-----END PGP SIGNATURE-----