SuSE MkDir Error Handling rctab Race Condition Vulnerability
BID:2207
Info
SuSE MkDir Error Handling rctab Race Condition Vulnerability
| Bugtraq ID: | 2207 |
| Class: | Race Condition Error |
| CVE: | |
| Remote: | No |
| Local: | Yes |
| Published: | Jan 13 2001 12:00AM |
| Updated: | Jan 13 2001 12:00AM |
| Credit: | This vulnerability was first announced by Paul Starzetz <[email protected]> on January 13, 2001 via Bugtraq. |
| Vulnerable: |
SuSE Linux 7.0 SuSE Linux 6.4 SuSE Linux 6.3 SuSE Linux 6.2 SuSE Linux 6.1 |
| Not Vulnerable: | |
Discussion
SuSE MkDir Error Handling rctab Race Condition Vulnerability
rctab is the Run Control Tab script included with the SuSE distribution of the Linux Operating System. SuSE is a freely available, Open Source Operating system maintained by SuSE Incorporated.
A race condition in the rctab script could allow an attacker to either gain elevated privileges, or append to and corrupt system files. This problem exists due to the insecure creation of files in the /tmp directory by the rctab script. Upon execution of the rctab script, rctab creates a subdirectory in the /tmp directory, using directory name rctmpdir.[pid of rctab process]. The script, which is normally run by root, does not check for an already existing rctmpdir.[pid of rctab process] directory. Additionally, the use of the -p flag with mkdir does not generate an error when the directory already exists, allowing the script to continue executing.
This problem makes it possible for a malicious user to guess the future process id of the rctab process, and create a range of directories that either will overwrite system files, or append to other system files and potentially allow elevation of privileges.
rctab is the Run Control Tab script included with the SuSE distribution of the Linux Operating System. SuSE is a freely available, Open Source Operating system maintained by SuSE Incorporated.
A race condition in the rctab script could allow an attacker to either gain elevated privileges, or append to and corrupt system files. This problem exists due to the insecure creation of files in the /tmp directory by the rctab script. Upon execution of the rctab script, rctab creates a subdirectory in the /tmp directory, using directory name rctmpdir.[pid of rctab process]. The script, which is normally run by root, does not check for an already existing rctmpdir.[pid of rctab process] directory. Additionally, the use of the -p flag with mkdir does not generate an error when the directory already exists, allowing the script to continue executing.
This problem makes it possible for a malicious user to guess the future process id of the rctab process, and create a range of directories that either will overwrite system files, or append to other system files and potentially allow elevation of privileges.
Exploit / POC
SuSE MkDir Error Handling rctab Race Condition Vulnerability
The following exploits were contributed by Paul Starzetz <[email protected]> :
The following exploits were contributed by Paul Starzetz <[email protected]> :
Solution / Fix
SuSE MkDir Error Handling rctab Race Condition Vulnerability
Solution:
This solution was supplied by Roman Drahtmueller <[email protected]> of SuSE Security:
Solution for the problem: remove the only occurrence of the string "-p " in the file /sbin/rctab. Change the line
mkdir -p ${tmpdir}
to read
mkdir ${tmpdir}
Solution:
This solution was supplied by Roman Drahtmueller <[email protected]> of SuSE Security:
Solution for the problem: remove the only occurrence of the string "-p " in the file /sbin/rctab. Change the line
mkdir -p ${tmpdir}
to read
mkdir ${tmpdir}
References
SuSE MkDir Error Handling rctab Race Condition Vulnerability
References:
References: