|
![]() ![]() |
CERT® Advisory CA-1995-09 Solaris ps VulnerabilityOriginal issue date: August 29, 1995Last revised: September 23, 1997 Updated Copyright statement
A complete revision history is at the end of this file. The text of this advisory is taken primarily from AUSCERT advisory AA-95.07, with their permission. A vulnerability exists in Solaris systems that allows a race condition to be exploited to gain root access. The essential problem is that the ps(1) program maintains a data file in the /tmp directory, and the /tmp directory is world-writable, allowing users to delete other users' files in /tmp. This vulnerability affects Solaris 2.x (SunOS 5.x) systems. An exploit program for this vulnerability has been published. We urge you to take the actions described in Section III as soon as possible. We will update this advisory as we receive additional information. Please check advisory files regularly for updates that relate to your site.
I. DescriptionA race condition exists in at least one Solaris 2.x (SunOS 5.x) system program that can be exploited to gain root access if the user has access to the temporary files. Access to temporary files may be obtained if the permissions on the /tmp and /var/tmp directories are set incorrectly. The permissions on the /tmp directory are often reset incorrectly by the system if tmpfs (which is mounting swap as /tmp) is in use.
II. ImpactUsers logged in to the system may gain unauthorized root privileges.
III. Solution
A. Determine if your system is vulnerableTo determine if you are running tmpfs, the following command can be used to verify if the file system for /tmp is swap:
% /usr/sbin/df -k /tmp Filesystem kbytes used avail capacity Mounted on swap 28348 12 28336 0% /tmpor look in the file /etc/vfstab for the configuration line: #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options swap - /tmp tmpfs - yes -If either of these two conditions exist, then you are running tmpfs and the system may automatically reset the permission bits of /tmp at the next reboot. To verify if your configuration is currently vulnerable, the following command may be used:
% /usr/bin/ls -ld /tmp drwxrwxrwt 2 root root 61 Aug 15 12:12 /tmp If the sticky bit (t) is not set (it will be an x), then the system is vulnerable. In addition, we recommend that the owner and group for /tmp be changed to root and root, respectively.
B. Perform the following workaroundsThese workarounds have been verified with Sun Microsystems. Apply these workarounds until you an install a patch. (Patch information is in Sec. C. below.)
1. Immediate - fix /tmp permissionsA workaround that takes effect immediately is to set the sticky bit on the /tmp directory using the following command as root: # /usr/bin/chmod 1777 /tmp Note that this command must be performed after each reboot if you are mounting swap as /tmp (using tmpfs). In addition, the ownership and group membership of the /tmp directory should be verified using /usr/bin/ls -ld /tmp, and if incorrect may be reset by: # /usr/bin/chown root /tmp # /usr/bin/chgrp root /tmp The AUSCERT UNIX Security Checklist addresses this issue in Section 5.5. This section is reproduced in the appendix of this advisory. The entire AUSCERT checklist may be obtained from these locations. Sites outside of Australia should use the ftp.cert.org FTP site.
ftp://ftp.cert.org/pub/tech_tips/AUSCERT_checklist_1.1
2. Permanent - make the above change to /tmp permissions permanentThe change noted in item B.1 above will be lost upon reboot. To make the changes permanent, create the following script as /etc/init.d/tmpfsfix: -----------------------------cut here--8<---------------------------- #!/bin/sh if [ -d /tmp ] then /usr/bin/chmod 1777 /tmp /usr/bin/chgrp root /tmp /usr/bin/chown root /tmp fi ------------------------------cut here---8<-------------------------- After creating this file, the following commands should be issued as root to make the file executable, set appropriate owner and group, and create the necessary symbolic link to ensure that it is executed upon reboot appropriately:
# /usr/bin/ln -s /etc/init.d/tmpfsfix /etc/rc2.d/S06tmpfix
# /usr/bin/chmod 744 /etc/init.d/tmpfsfix
# /usr/bin/chown root /etc/init.d/tmpfsfix
# /usr/bin/chgrp sys /etc/init.d/tmpfsfix
# /bin/rm -f /etc/rc3.d/S79tmpfix
If you have done item B.1 above, you can reboot at your leisure. Otherwise, reboot your system now. In either case, verify the permissions of /tmp immediately after your next system reboot.
3. Check /var/tmp permissionsWe recommend that you also check and correct the /var/tmp directory. Note that this directory is not usually mounted as tmpfs, so it normally would not be subject to automatic resetting of its permission bits on reboot.
% /usr/bin/ls -ld /var/tmp drwxrwxrwt 2 root root 512 Aug 15 11:35 /var/tmp
C. Install a vendor patchOn September 20, 1995, Sun Microsystems, Inc., provided the following information in their advisory. II. Announcement of patches for Solaris 2.x "ps_data" vulnerabilityA. Patch listWe have produced patches for the versions of SunOS shown below.
OS version Patch ID Patch File Name ---------- --------- --------------- 5.3 101545-02 101545-02.tar.Z 5.4 102711-01 102711-01.tar.Z 5.4_x86 102712-01 102712-01.tar.Z
B. Patch notes1. SunOS 4.1.x systems are not affected by this bug. 2. The fix has been applied to the upcoming version of Solaris.
III. Checksum TableIn the checksum table we show the BSD and SVR4 checksums and MD5 digital signatures for the compressed tar archives.
File BSD SVR4 MD5 Name Checksum Checksum Digital Signature --------------- ----------- ---------- -------------------------------- 101545-02.tar.Z 41218 77 47754 153 A8FB866780E7207D26CF16210BCFDC83 102711-01.tar.Z 17256 69 20376 138 98A449372C5ABBDB7C37B08BFE0E6ED7 102712-01.tar.Z 29867 68 56717 136 E324004BB8C09990B2790CB5D29D3AF5 The checksums shown above are from the BSD-based checksum (on 4.1.x, /bin/sum; on Solaris 2.x, /usr/ucb/sum) and from the SVR4 version on Solaris 2.x (/usr/bin/sum).
Appendix: Excerpt from AUSCERT UNIX Security Checklist (Version 1.1) 5.5 File Permissions
The CERT Coordination Center staff thanks AUSCERT, the Australian response team, for their permission to reuse text from their advisory AA-95.07 and for their cooperation and assistance.
UPDATESIf anyone has trouble retrieving the electronic file CA-95.09.Solaris.ps.vul, they should use the file name CA-95.09.Solaris-ps.vul. This document is available from: http://www.cert.org/advisories/CA-1995-09.html CERT/CC Contact Information
Phone: +1 412-268-7090 (24-hour hotline) Fax: +1 412-268-6989 Postal address: CERT/CC personnel answer the hotline 08:00-17:00 EST(GMT-5) / EDT(GMT-4) Monday through Friday; they are on call for emergencies during other hours, on U.S. holidays, and on weekends. Using encryptionWe strongly urge you to encrypt sensitive information sent by email. Our public PGP key is available from If you prefer to use DES, please call the CERT hotline for more information. Getting security informationCERT publications and other security information are available from our web site
* "CERT" and "CERT Coordination Center" are registered in the U.S. Patent and Trademark Office.
NO WARRANTY Conditions for use, disclaimers, and sponsorship information
Copyright 1995, 1996 Carnegie Mellon University. Revision History
Sep. 23, 1997 Updated copyright statement
Aug. 30, 1996 Information previously in the README was inserted
into the advisory. Updated version number of AUSCERT checklist
and the appendix.
Sep. 20, 1995 Sec. III.A.1 - corrected the command and explanation for
checking your configuration.
Sec. III.B.1 - corrected commands for verifying ownership and
group membership.
Sec. III.B.2 - replaced this section, which was incorrect.
Sec. III.B.3 - replaced the text and command.
Sec. III.C - added this section, which contains Sun patch
information.
Appendix - corrected item 10.
Updates section - added a note about the file name.
|









