CVE-2017-16638

9.8 CRITICAL

📋 TL;DR

This vulnerability allows local users in the 'qemu' group to escalate privileges to root by exploiting a race condition in the VDE OpenRC service script. The issue occurs when the script recursively changes ownership of directories, enabling attackers to create hard links to sensitive files. Only Gentoo Linux systems with the vulnerable net-misc/vde package installed are affected.

💻 Affected Systems

Products:
  • Gentoo net-misc/vde package
Versions: Versions before 2.3.2-r4
Operating Systems: Gentoo Linux
Default Config Vulnerable: ⚠️ Yes
Notes: Requires VDE package installed and users in the qemu group. Not all Gentoo systems have VDE installed by default.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Local attacker gains full root privileges, enabling complete system compromise, data theft, persistence establishment, and lateral movement.

🟠

Likely Case

Privileged user in qemu group escalates to root to install malware, access sensitive data, or modify system configurations.

🟢

If Mitigated

With proper group membership controls and timely patching, impact is limited to denial of service at most.

🌐 Internet-Facing: LOW - This is a local privilege escalation requiring existing access to the system.
🏢 Internal Only: HIGH - Any user in the qemu group can exploit this to gain root access on affected systems.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires local access and membership in the qemu group. The race condition is relatively straightforward to trigger.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.3.2-r4

Vendor Advisory: https://security.gentoo.org/glsa/201711-11

Restart Required: No

Instructions:

1. Update package: emerge --sync && emerge -av net-misc/vde
2. Verify version: emerge -pv net-misc/vde | grep '2.3.2-r4'
3. Rebuild if necessary: emerge @preserved-rebuild

🔧 Temporary Workarounds

Remove qemu group membership

linux

Temporarily remove users from the qemu group to prevent exploitation

gpasswd -d <username> qemu

Disable VDE service

linux

Stop and disable the vulnerable OpenRC service

rc-service vde stop
rc-update del vde

🧯 If You Can't Patch

  • Remove all users from the qemu group except absolutely necessary ones
  • Implement strict monitoring of users in the qemu group and their activities

🔍 How to Verify

Check if Vulnerable:

Check installed version: emerge -pv net-misc/vde | grep -E '\[I\]' && echo 'Check if version is <2.3.2-r4'

Check Version:

emerge -pv net-misc/vde | grep -oP '(?<=\[I\] ).*?(?= )'

Verify Fix Applied:

Verify version: emerge -pv net-misc/vde | grep '2.3.2-r4' && echo 'Patched'

📡 Detection & Monitoring

Log Indicators:

  • Unusual privilege escalation attempts by qemu group users
  • Multiple hard link creation attempts in /tmp or /var/run directories
  • Unexpected chown operations on system directories

Network Indicators:

  • None - this is a local privilege escalation

SIEM Query:

source="auth.log" AND ("qemu" OR "vde") AND ("privilege" OR "escalation" OR "chown")

🔗 References

📤 Share & Export