-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =============================================================================== >> CERT-NL, 01-Mar-2000 << >> All CERT-NL information has been moved to http://cert.surfnet.nl. Links << >> to CERT-NL information contained in this advisory are therefore outdated. << >> << >> CERT-NL also has stopped the CERT-CC-Mirror service. Due to this the << >> links to the CERT-CC mirror are obsolete. Visit the CERT-CC site for the << >> complete CERT-CC advisory texts: http://www.cert.org << =============================================================================== Content-Type: text/plain; charset=us-ascii =============================================================================== Security Advisory CERT-NL =============================================================================== Author/Source : Don Stikvoort Index : S-97-43 Distribution : World Page : 1 Classification: External Version: 1 Subject : SGI IRIX login/scheme Buffer Overrun Vuln. Date : 30-May-97 =============================================================================== By courtesy of AUSCERT we received information on an SGI IRIX login/scheme Buffer Overrun vulnerability. This can lead to root compromises. NOTE: THIS IS ABOUT THE ***login*** PROGRAM! CERT-NL recommends taking action 3.1 mentioned below AND INSTALL THE WRAPPER PROVIDED BY COURTESY OF AUSCERT. SGI acknowledged this problem on May 28th, in a way which is less than helpful in the specific case of the login program: Silicon Graphics Inc. acknowledges the login/scheme buffer overrun vulnerability publically reported by several individuals and in AUSCERT Advisory AA-97.22. Currently, Silicon Graphics Inc. is investigating and no further information is available for public release at this time. As further information becomes available, additional advisories will be issued via the normal SGI security information distribution methods including the wiretap mailing list. ============================================================================== AA-97.22 AUSCERT Advisory SGI IRIX login/scheme Buffer Overrun Vulnerability 28 May 1997 Last Revised: -- - --------------------------------------------------------------------------- AUSCERT has received information that a vulnerability exists in login(1), distributed under IRIX 6.2. Other versions (including IRIX 5.x) may also be vulnerable. This vulnerability may allow local users to gain root privileges. Exploit information involving this vulnerability has been made publicly available. At this stage, AUSCERT is unaware of any official vendor patches. AUSCERT recommends that sites apply the workaround given in Section 3 until vendor patches are made available. This advisory will be updated as more information becomes available. - --------------------------------------------------------------------------- 1. Description login(1) is a program used at the beginning of each terminal session that allows users to identify themselves to the session. Under current versions of IRIX this functionality is supplied by the program /usr/lib/iaf/scheme. The login program is a symbolic link to /usr/lib/iaf/scheme. Due to insufficient bounds checking on arguments which are supplied by users, it is possible to overwrite the internal stack space of the scheme program while it is executing. By supplying a carefully designed argument to the scheme program, intruders may be able to force scheme to execute arbitrary commands. As scheme is setuid root, this may allow intruders to run arbitrary commands with root privileges. The login program is installed in /usr/bin/login. Under default configurations this is a symbolic link to /usr/lib/iaf/scheme. % ls -l /usr/bin/login lrwxr-xr-x 1 root sys 17 Nov 22 1994 /usr/bin/login -> ../lib/iaf/scheme % ls -l /usr/lib/iaf/scheme -rwsr-xr-x 1 root sys 65832 Nov 22 1994 /usr/lib/iaf/scheme Exploit information involving this vulnerability has been made publicly available. Although AUSCERT has only verified this vulnerability under IRIX 6.2, this vulnerability is believed to affect other versions of IRIX, including IRIX 5.x. 2. Impact This vulnerability may allow local users to gain root privileges. 3. Workarounds/Solution AUSCERT recommends that sites prevent the exploitation of this vulnerability in login/scheme by immediately applying the workaround given in Section 3.1. To maintain the full login/scheme functionality, AUSCERT recommends applying the workaround given in Section 3.2. Currently there are no vendor patches available that address this vulnerability. AUSCERT recommends that official vendor patches be installed when they are made available. 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 scheme program immediately. # ls -l /usr/lib/iaf/scheme -rwsr-xr-x 1 root sys 58324 Nov 28 1996 /usr/lib/iaf/scheme # chmod 500 /usr/lib/iaf/scheme # ls -l /usr/lib/iaf/scheme -r-x------ 1 root sys 58324 Nov 28 1996 /usr/lib/iaf/scheme 3.2 Install scheme 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 as described in Section 3.2.1. For sites without a C compiler, AUSCERT has made pre-compiled binaries available (Section 3.2.2). 3.2.1 Installing the wrapper from source 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 scheme 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 scheme command. The wrapper program can also be configured to syslog any failed attempts to execute scheme 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 scheme, 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.2.2 Installing the wrapper binaries A pre-compiled wrapper binary is provided for sites that wish to install the wrapper but do not have a C compiler available. AUSCERT has compiled the wrapper on IRIX 5.3, however later versions of IRIX should be able to use the wrapper binary without recompilation. The following compile time options have been used to create the binaries: REAL_PROG='"/usr/lib/iaf/scheme.real"' MAXARGLEN=32 SYSLOG More information on these options can be found in Section 3.2.1 and in the overflow_wrapper.c source code. The pre-compiled binaries for the wrapper program can be retrieved from: ftp://ftp.auscert.org.au/pub/auscert/tools/ AA-97.22-scheme_wrapper.tar.Z The MD5 checksum for AA-97.22-scheme_wrapper.tar.Z is: MD5 (AA-97.22-scheme_wrapper.tar.Z) = dc302aa275a4009d1545180bfce8ebf4 AA-97.22-scheme_wrapper.tar.Z contains a README file with installation instructions, as well as a pre-compiled binary. Sites are encouraged to carefully read the installation notes in the README file before installation. - --------------------------------------------------------------------------- AUSCERT thanks Ian Farquhar for his assistance in the production of this advisory. Thanks also to the Prentice Centre, University of Queensland, for providing test equipment. - --------------------------------------------------------------------------- ============================================================================== CERT-NL is the Computer Emergency Response Team for SURFnet customers. SURFnet is the Dutch network for educational, research and related institutes. CERT-NL is a member of the Forum of Incident Response and Security Teams (FIRST). All CERT-NL material is available under: http://cert.surfnet.nl/ In case of computer or network security problems please contact your local CERT/security-team or CERT-NL (if your institute is NOT a SURFnet customer please address the appropriate (local) CERT/security-team). CERT-NL is one/two hour(s) ahead of UTC (GMT) in winter/summer, i.e. UTC+0100 in winter and UTC+0200 in summer (DST). Email: cert-nl@surfnet.nl ATTENDED REGULARLY ALL DAYS Phone: +31 302 305 305 BUSINESS HOURS ONLY Fax: +31 302 305 329 BUSINESS HOURS ONLY Snailmail: SURFnet bv Attn. CERT-NL P.O. Box 19035 NL - 3501 DA UTRECHT The Netherlands NOODGEVALLEN: 06 22 92 35 64 ALTIJD BEREIKBAAR EMERGENCIES : +31 6 22 92 35 64 ATTENDED AT ALL TIMES CERT-NL'S EMERGENCY PHONENUMBER IS ONLY TO BE USED IN CASE OF EMERGENCIES: THE SURFNET HELPDESK OPERATING THE EMERGENCY NUMBER HAS A *FIXED* PROCEDURE FOR DEALING WITH YOUR ALERT AND WILL IN REGULAR CASES RELAY IT TO CERT-NL IN AN APPROPRIATE MANNER. CERT-NL WILL THEN CONTACT YOU. =============================================================================== -----BEGIN PGP SIGNATURE----- Version: PGP 6.5.1i iQA/AwUBOL6IXTSYjBqwfc9jEQKoDACeJ1WNN/mpn4f7qyEucNsbm8LK2O8AoIHV sBrmfNPcsJp6rQX0DCGpIRvi =CbkL -----END PGP SIGNATURE-----