header-logo
Suggest Exploit
vendor:
man Command
by:
5.5
CVSS
MEDIUM
Arbitrary File Creation
377
CWE
Product Name: man Command
Affected Version From:
Affected Version To:
Patch Exists: NO
Related CWE:
CPE: a:man:man
Metasploit:
Other Scripts:
Platforms Tested: Linux, Unix

Arbitrary File Creation Vulnerability in man Command

The man command creates a temporary file under /tmp with a predictable name and is willing to follow symbolic links. This allows malicious local users to create arbitrarily named files by creating symbolic links to desired files.

Mitigation:

Upgrade to a version of man that does not have this vulnerability. Avoid running the man command as a privileged user.
Source

Exploit-DB raw data:

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

The man command created a temporary file under /tmp with a predictable name and is willing to follow symbolic links. This may allow malicious local users to create arbitrarily named files.

zsoelim(1) is a utility part of the man package which prepocess man pages and satisfy .so requests in roff input. This utility may be called when running the man(1) command. It creates temporary filenames are of the form "/tmp/zman0<pid>aaa" where <pid> is the process id of the zsoelim process. The program fails to check for the existance of symlinks and follows them creating arbitrary files with the permissions of the user running man. 

perl -e 'for($i=1000;$i<5000;$i++){symlink "/etc/nologin", "/tmp/zman0${i}aaa";}'