AA-97.19.IRIX.df.buffer.overflow.vul
71f441a4c198c6cf9366de3263d978d0fa982b470448963691e41cfcaba54c85
-----BEGIN PGP SIGNED MESSAGE-----
===========================================================================
AA-97.19 AUSCERT Advisory
SGI IRIX df Buffer Overrun Vulnerability
26 May 1997
Last Revised: 17 December 1997
Changed Section 3 to include vendor patch and bulletin
information.
A complete revision history is at the end of this file.
- ---------------------------------------------------------------------------
AUSCERT has received information that a vulnerability exists in df(1),
distributed under IRIX versions 5.x and 6.x. Other IRIX versions 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
df(1) is a program used to display statistics about the amount of used
and free disc space on file systems.
Due to insufficient bounds checking on arguments which are supplied
by users, it is possible to overwrite the internal stack space of the
df program while it is executing. By supplying a carefully designed
argument to the df program, intruders may be able to force df to
execute arbitrary commands. As df 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 /sbin/df
df is installed by default in /sbin. Sites are encouraged to check
for the presence of this program regardless of the version of IRIX
installed.
Specific versions of IRIX which are vulnerable to this problem are
listed in Section 3.3.
Exploit information involving this vulnerability has been made publicly
available.
2. Impact
Local users may 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. If the df functionality is required by non-root users and patches
can not be installed, 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 df program immediately. As df will no longer work for non-root
users, it is recommended that the execute permissions for them also
be removed.
# ls -l /sbin/df
-r-sr-xr-x 1 root sys 23136 Nov 22 1994 /sbin/df
# chmod 500 /sbin/df
# ls -l /sbin/df
-r-x------ 1 root sys 23136 Nov 22 1994 /sbin/df
3.2 Install df 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.
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 df 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 df command. The wrapper program can also be configured
to syslog any failed attempts to execute df 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 df, 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 a security bulletin containing
information on this vulnerability including patch details. The original
release of this bulletin can be retrieved from:
ftp://sgigate.sgi.com/security/19970505-02-PX
Information on patches which address the vulnerability described in
this advisory has been extracted from the SGI bulletin and is listed
below.
OS Version Vulnerable? Patch # Other Actions
---------- ----------- ------- -------------
IRIX 3.x unknown not avail Note 1
IRIX 4.x unknown not avail Note 1
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 2224
IRIX 6.0.x yes not avail Note 1
IRIX 6.1 yes not avail Note 1
IRIX 6.2 yes 2177
IRIX 6.3 yes 2232
IRIX 6.4 yes 2233
NOTES
1) upgrade operating system or see "Temporary Solution" section.
"Temporary Solution" refers to the SGI bulletin but is equivalent to
the suggestions given in our AUSCERT advisory in section 3.1.
These patches can be retrieved from:
http://www.sgi.com/Support/Secur/security.html
- ---------------------------------------------------------------------------
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
17 Dec 1997 Silicon Graphics has released a security bulletin
addressing the vulnerability described in this advisory.
Section 3 has been modified to include vendor patch
information.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: ftp://ftp.auscert.org.au/pub/auscert/AUSCERT_PGP.key
iQCVAwUBNJfY6Ch9+71yA2DNAQGAUwP9Fghb3FJAix51VrHyXEvtRqnAmF89wbD0
eb6xBonVCnvY3zxQBfUXmHlCHXhtSUtqaHE4gsCbR0i+EZtlvZSy+fFdCMcgfc/J
1nsUD2tg1ElOxsqvJP48wHGoVbfv++KFkxGCOSXGCxPOlh9wDnXf46AIa3lbtFft
rtCGapZyH+8=
=LKex
-----END PGP SIGNATURE-----