-----BEGIN PGP SIGNED MESSAGE----- __________________________________________________________ The U.S. Department of Energy Computer Incident Advisory Capability ___ __ __ _ ___ / | /_\ / \___ __|__ / \ \___ __________________________________________________________ INFORMATION BULLETIN Solaris 2.x Buffer Overflow Vulnerabilities (ps, chkey) May 22, 1997 17:00 GMT Number H-59 ______________________________________________________________________________ PROBLEM: Two buffer overflow vulnerabilities have been identified: 1) ps(1) program 2) chkey(1) program PLATFORM: All platforms with Solaris 2.x DAMAGE: These vulnerabilities may allow local users to gain root privileges. SOLUTION: Until patches are available, take the steps outlined in Section 3 of each advisory as soon as possible. ______________________________________________________________________________ VULNERABILITY Exploit details involving these vulnerabilities have been made ASSESSMENT: publicly available. ______________________________________________________________________________ [ Start AUSCERT Advisories ] 1) ps(1) program =========================================================================== AA-97.17 AUSCERT Advisory Solaris 2.x ps Buffer Overflow Vulnerability 21 May 1997 Last Revised: - ----------------------------------------------------------------------------- AUSCERT has received information that a vulnerability exists in the ps(1) program under Solaris 2.x. This vulnerability may allow local users to gain root privileges. Exploit information involving this vulnerability has been made publicly available. Currently there are no vendor patches available that address 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 AUSCERT has received information that a vulnerability exists in the Solaris 2.x ps(1) program. ps is a program used to print information about active processes on the system. Due to insufficient bounds checking on arguments passed to the ps program, it is possible to overwrite the internal data space of this program while it is executing. This vulnerability may allow local users to gain root privileges. Exploit information involving this vulnerability has been made publicly available. Under Solaris 2.x there are two distinct vulnerable versions of ps. These are installed by default in /usr/bin/ and /usr/ucb/. Sun Microsystems is aware of this problem and is currently investigating it. 2. Impact Local users may gain root privileges. 3. Workarounds/Solution AUSCERT recommends that sites limit the possible exploitation of this vulnerability by immediately applying the workaround given in Section 3.1. To maintain the functionality of ps, 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 ps program immediately. As the ps program will no longer work for non-root users, it is recommended that the execute permissions for them also be removed. # ls -l /usr/bin/ps /usr/ucb/ps -r-sr-xr-x 1 root sys 23752 Oct 25 1995 /usr/bin/ps -rwsr-xr-x 1 root sys 23408 Oct 25 1995 /usr/ucb/ps # chmod 500 /usr/bin/ps /usr/ucb/ps # ls -l /usr/bin/ps /usr/ucb/ps -r-x------ 1 root sys 23752 Oct 25 1995 /usr/bin/ps -r-x------ 1 root sys 23408 Oct 25 1995 /usr/ucb/ps 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 as described in Section 3.2.1. For sites without a C compiler, AUSCERT has made pre-compiled binaries available for Solaris 2.4, 2.5 and 2.5.1 (Section 3.2.2). 3.2.1 Installing the wrapper from source The source for the wrapper, including installation instructions, can be obtained from: ftp://ftp.auscert.org.au/pub/auscert/tools/overflow_wrapper/ overflow_wrapper.c This wrapper replaces the ps 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 ps command. The wrapper program can also be configured to syslog any failed attempts to execute ps with arguments exceeding MAXARGLEN. For further instructions on using this wrapper, please read the comments at the top of overflow_wrapper.c. The wrapper will need to be applied to both ps programs on the system (/usr/bin/ps and /usr/ucb/ps). When compiling overflow_wrapper.c for use with ps, 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 Pre-compiled wrapper binaries are provided for sites that wish to install the wrapper but do not have a C compiler available. AUSCERT has compiled the wrapper on Solaris 2.4, 2.5 and 2.5.1. The following compile time options have been used to the create the binaries: REAL_PROG='"/usr/bin/ps.real"' MAXARGLEN=32 SYSLOG and REAL_PROG='"/usr/ucb/ps.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/ps_wrapper.tar.Z The MD5 checksum for ps_wrapper.tar.Z is: MD5 (ps_wrapper.tar.Z) = 6c0a9a2739561aba5968fc54b10d8c32 ps_wrapper.tar.Z contains a README file with installation instructions, as well as pre-compiled binaries for /usr/bin/ps and /usr/ucb/ps under Solaris 2.4, 2.5 and 2.5.1. The binaries have been linked statically so they are larger than the default ps binary. Sites are encouraged to carefully read the installation notes in the README file before installation. =========================================================================== 2) chkey(1) program =========================================================================== AA-97.18 AUSCERT Advisory Solaris 2.x chkey Buffer Overflow Vulnerability 22 May 1997 Last Revised: - ----------------------------------------------------------------------------- AUSCERT has received information that a vulnerability exists in the chkey(1) program under Solaris 2.x. This vulnerability may allow local users to gain root privileges. Exploit information involving this vulnerability has been made publicly available. Currently there are no vendor patches available that address 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 AUSCERT has received information that a vulnerability exists in the Solaris 2.x chkey(1) program. chkey is used to change a user's secure RPC public key and secret key pair. Due to insufficient bounds checking on arguments passed to the chkey program, it is possible to overwrite the internal data space of this program while it is executing. As chkey has setuid root permissions, this vulnerability may allow local users to gain root privileges. Exploit information involving this vulnerability has been made publicly available. chkey under Solaris 2.x is located by default in /usr/bin/. Sun Microsystems is aware of this problem and is currently investigating it. 2. Impact Local users may gain root privileges. 3. Workarounds/Solution AUSCERT recommends that sites limit the possible exploitation of this vulnerability by immediately applying the workaround given in Section 3.1. To maintain the functionality of chkey, 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 chkey program immediately. As the chkey program will no longer work for non-root users, it is recommended that the execute permissions for them also be removed. # ls -l /usr/bin/chkey -r-sr-xr-x 1 root sys 19608 Oct 25 1995 /usr/bin/chkey # chmod 500 /usr/bin/chkey # ls -l /usr/bin/chkey -r-x------ 1 root sys 19608 Oct 25 1995 /usr/bin/chkey For those sites which require the chkey functionality, AUSCERT recommends applying the workaround given in Section 3.2. 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 as described in Section 3.2.1. For sites without a C compiler, AUSCERT has made pre-compiled binaries available for Solaris 2.4, 2.5 and 2.5.1 (Section 3.2.2). 3.2.1 Installing the wrapper from source The source for the wrapper, including installation instructions, can be obtained from: ftp://ftp.auscert.org.au/pub/auscert/tools/overflow_wrapper/ overflow_wrapper.c This wrapper replaces the chkey 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 chkey command. The wrapper program can also be configured to syslog any failed attempts to execute chkey 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 chkey, 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 Pre-compiled wrapper binaries are provided for sites that wish to install the wrapper but do not have a C compiler available. AUSCERT has compiled the wrapper on Solaris 2.4, 2.5 and 2.5.1. The following compile time options have been used to the create the binaries: REAL_PROG='"/usr/bin/chkey.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.18-chkey_wrapper.tar.Z The MD5 checksum for AA-97.18-chkey_wrapper.tar.Z is: MD5 (AA-97.18-chkey_wrapper.tar.Z) = bafd43c2357156595d65c7ed38fd6aeb AA-97.18-chkey_wrapper.tar.Z contains a README file with installation instructions, as well as pre-compiled binaries for /usr/bin/chkey under Solaris 2.4, 2.5 and 2.5.1. The binaries have been linked statically so they are larger than the default chkey binary. Sites are encouraged to carefully read the installation notes in the README file before installation. =========================================================================== [ End AUSCERT Advisories ] ______________________________________________________________________________ CIAC wishes to acknowledge the contributions of AUSCERT and Nelson Marques (The University of Queensland) for the information contained in this bulletin. Thanks also to the Department of Mathematics(The University of Queensland) for providing temporary test equipment. ______________________________________________________________________________ CIAC, the Computer Incident Advisory Capability, is the computer security incident response team for the U.S. Department of Energy (DOE) and the emergency backup response team for the National Institutes of Health (NIH). CIAC is located at the Lawrence Livermore National Laboratory in Livermore, California. CIAC is also a founding member of FIRST, the Forum of Incident Response and Security Teams, a global organization established to foster cooperation and coordination among computer security teams worldwide. CIAC services are available to DOE, DOE contractors, and the NIH. CIAC can be contacted at: Voice: +1 510-422-8193 FAX: +1 510-423-8002 STU-III: +1 510-423-2604 E-mail: ciac@llnl.gov For emergencies and off-hour assistance, DOE, DOE contractor sites, and the NIH may contact CIAC 24-hours a day. During off hours (5PM - 8AM PST), call the CIAC voice number 510-422-8193 and leave a message, or call 800-759-7243 (800-SKY-PAGE) to send a Sky Page. CIAC has two Sky Page PIN numbers, the primary PIN number, 8550070, is for the CIAC duty person, and the secondary PIN number, 8550074 is for the CIAC Project Leader. Previous CIAC notices, anti-virus software, and other information are available from the CIAC Computer Security Archive. World Wide Web: http://ciac.llnl.gov/ Anonymous FTP: ciac.llnl.gov (128.115.19.53) Modem access: +1 (510) 423-4753 (28.8K baud) +1 (510) 423-3331 (28.8K baud) CIAC has several self-subscribing mailing lists for electronic publications: 1. CIAC-BULLETIN for Advisories, highest priority - time critical information and Bulletins, important computer security information; 2. CIAC-NOTES for Notes, a collection of computer security articles; 3. SPI-ANNOUNCE for official news about Security Profile Inspector (SPI) software updates, new features, distribution and availability; 4. SPI-NOTES, for discussion of problems and solutions regarding the use of SPI products. Our mailing lists are managed by a public domain software package called Majordomo, which ignores E-mail header subject lines. To subscribe (add yourself) to one of our mailing lists, send the following request as the E-mail message body, substituting ciac-bulletin, ciac-notes, spi-announce OR spi-notes for list-name: E-mail to ciac-listproc@llnl.gov or majordomo@tholia.llnl.gov: subscribe list-name e.g., subscribe ciac-notes You will receive an acknowledgment email immediately with a confirmation that you will need to mail back to the addresses above, as per the instructions in the email. This is a partial protection to make sure you are really the one who asked to be signed up for the list in question. If you include the word 'help' in the body of an email to the above address, it will also send back an information file on how to subscribe/unsubscribe, get past issues of CIAC bulletins via email, etc. PLEASE NOTE: Many users outside of the DOE, ESnet, and NIH computing communities receive CIAC bulletins. If you are not part of these communities, please contact your agency's response team to report incidents. Your agency's team will coordinate with CIAC. The Forum of Incident Response and Security Teams (FIRST) is a world-wide organization. A list of FIRST member organizations and their constituencies can be obtained via WWW at http://www.first.org/. This document was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. LAST 10 CIAC BULLETINS ISSUED (Previous bulletins available from CIAC) H-29a: HP-UX sendmail Patches Vulnerability H-50: HP-UX SYN Flood and libXt patches H-51: Vulnerability in libXt H-52: IRIX csetup Program Vulnerability H-53: Vulnerability in webdist.cgi H-54: Vulnerability in xlock H-55: IRIX netprint Program Security Vulnerability H-56: Solaris 2.x lp temporary files creation Vulnerability H-57: Windows NT/95 Out of Band Data Exploit H-58: IRIX runpriv Program Vulnerability -----BEGIN PGP SIGNATURE----- Version: 4.0 Business Edition iQCVAwUBM4TR07nzJzdsy3QZAQHnNwP6AvH38FhGSy9fHmeyZTQhU17XB5iOolfo MJD54Y0S4umO9bokjnOSUD4t7X6Qz7bpPMxuazn4aAEqMNxx/P7yQcbNoOXX8C1y 52FG2N9UbcrzoMN0YJAQ8ar74X8AgScN5AaSdygf2Q+e9AGbrOFSGhMfJwUP8ITp tg/dsFzK+1o= =TPAj -----END PGP SIGNATURE-----