vendor:
N/A
by:
zx2c4
7,2
CVSS
HIGH
Time-of-Check-Time-of-Use (TOCTOU)
362
CWE
Product Name: N/A
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: Gentoo
2015
Virtfshell
Virtfshell is an exploit that takes advantage of the Time-of-Check-Time-of-Use (TOCTOU) vulnerability in the virtfs-proxy-helper from QEMU. The exploit makes use of the inotify_init() and inotify_add_watch() functions to monitor the /tmp/virtfshell directory for changes. When the virtfs-proxy-helper is executed, it creates a socket in the /tmp/virtfshell directory. The exploit then replaces the socket with a symlink to /etc/shadow, which is then chown'd to the user's UID and GID, thus elevating the user to root. The exploit then runs a cleanup script to remove any traces of the exploit.
Mitigation:
The best way to mitigate this vulnerability is to not make virtfs-proxy-helper from QEMU either SUID or give it CAP_CHOWN fs capabilities.