-----BEGIN PGP SIGNED MESSAGE----- __________________________________________________________ The U.S. Department of Energy Computer Incident Advisory Capability ___ __ __ _ ___ / | /_\ / \___ __|__ / \ \___ __________________________________________________________ INFORMATION BULLETIN Solaris 2.x eject Buffer Overrun Vulnerability March 14, 1997 18:00 GMT Number H-41 ______________________________________________________________________________ PROBLEM: A vulnerability exists in eject(1). PLATFORM: All platforms running Solaris 2.4, 2.5, and 2.5.1. Earlier versions may also be vulnerable. DAMAGE: This vulnerability may allow local users to gain root privileges. SOLUTION: Until patches are available, take the steps outlined in Section 3 as soon as possible. ______________________________________________________________________________ VULNERABILITY Exploit details involving this vulnerability have been made ASSESSMENT: publicly available. ______________________________________________________________________________ [ Start AUSCERT Advisory ] =========================================================================== AA-97.10 AUSCERT Advisory Solaris 2.x eject Buffer Overrun Vulnerability 14 March 1997 Last Revised: -- - ---------------------------------------------------------------------------- AUSCERT has received information that a vulnerability exists in eject(1), distributed under Solaris 2.4, 2.5 and 2.5.1. Earlier versions may 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 eject(1) is a program used for those removable media devices that do not have a manual eject button, or for those that do, but are managed by Volume Management Due to insufficient bounds checking on arguments which are supplied by users, it is possible to overwrite the internal stack space of the eject program while it is executing. By supplying a carefully designed argument to the eject program, intruders may be able to force eject to execute arbitrary commands. As eject 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/eject eject is installed by default in /usr/bin. Sites are encouraged to check for the presence of this program regardless of the version of Solaris installed. Exploit information involving this vulnerability has been made publicly available. Sun Microsystems has informed AUSCERT that they are currently working on this vulnerability. 2. Impact Local users may gain root privileges. 3. Workarounds/Solution AUSCERT recommends that sites prevent the exploitation of this vulnerability in eject by immediately applying the workaround given in Section 3.1. If the eject functionality is required 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 eject program immediately. As eject will no longer work for non-root users, it is recommended that the execute permissions also be removed. # ls -l /usr/bin/eject -r-sr-xr-x 1 root other 5804 Mar 14 09:47 /usr/bin/eject # chmod 500 /usr/bin/eject # ls -l /usr/bin/eject -r-x------ 1 root other 5804 Mar 14 09:47 /usr/bin/eject 3.2 Install eject 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.1.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.c This wrapper replaces the eject 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 eject command. The wrapper program can also be configured to syslog any failed attempts to execute eject 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 eject, AUSCERT recommends defining MAXARGLEN to be 32. The MD5 checksum for Version 1.0 of overflow_wrapper.c is: MD5 (overflow_wrapper.c) = f7f83af7f3f0ec1188ed26cf9280f6db 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/eject.real"' MAXARGLEN=32 SYSLOG More information on these options can be found in Section 3.1.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/eject_wrapper.tar.Z The MD5 checksum for eject_wrapper.tar.Z is: MD5 (eject_wrapper.tar.Z) = 1ae34aea7a637d6464105cbec7ff4443 eject_wrapper.tar.Z contains a README file with installation instructions, as well as pre-compiled binaries for Solaris 2.4, 2.5 and 2.5.1. The binaries have been linked statically so they are larger than the default eject binary. Sites are encouraged to carefully read the installation notes in the README file before installation. 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 vulnerability 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 eject program is not needed by many sites. If sites had previously disabled this program, they would not have been susceptible to this latest vulnerability. [ End AUSCERT Advisory ] ______________________________________________________________________________ CIAC wishes to acknowledge the contributions of AUSCERT, Brian Meilak (Queensland University of Technology) and Sun Microsystems for the information contained in this bulletin. ______________________________________________________________________________ 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 ListProcessor, 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 and valid information for LastName FirstName and PhoneNumber when sending E-mail to ciac-listproc@llnl.gov: subscribe list-name LastName, FirstName PhoneNumber e.g., subscribe ciac-notes OHara, Scarlett W. 404-555-1212 x36 You will receive an acknowledgment containing address, initial PIN, and information on how to change either of them, cancel your subscription, or get help. 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-31: HP-UX ppl executable Vulnerability H-32: HP-UX ppl Core Dump Vulnerability H-33: HP-UX ftpd/kftpd Vulnerability H-34: Vulnerability in innd H-35: HP-UX vgdisplay command Vulnerability H-36: Solaris 2.x CDE sdtcm_convert Vulnerability H-37: Solaris 2.x passwd buffer Overrun Vulnerability H-38: Internet Explorer 3.x Vulnerabilities H-39: SGI IRIX fsdump Vulnerability H-40: DIGITAL Security Vulnerabilities (DoP, delta-time) -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMynAZrnzJzdsy3QZAQFSJgQAwAE9VcBGydj28O1M0a+zXLMvLdQ3nJtv GmKkMZna0B+LdtR+Ttt5SsYbbYS8+1lKLpw+u6RnQRVaRagGhGsnNowtf0WcZGJs CMwSeyyT2T/+IOQ3urctgbuC4+EB1zG7pjNJs0/txAgCm2cGpY6NqUcKnd3v5MDM 1nxwZ3nRhS8= =Ghzh -----END PGP SIGNATURE-----