CVE-2024-24474
📋 TL;DR
This CVE describes an integer underflow and buffer overflow vulnerability in QEMU's SCSI emulation (esp.c). Attackers can exploit this to execute arbitrary code or cause denial-of-service on the QEMU host system. Affected users include anyone running vulnerable QEMU versions with SCSI device emulation enabled.
💻 Affected Systems
- QEMU
📦 What is this software?
Qemu by Qemu
⚠️ Risk & Real-World Impact
Worst Case
Full host compromise via arbitrary code execution on the QEMU hypervisor, potentially leading to escape from guest VM to host system.
Likely Case
Denial-of-service (QEMU process crash) or limited information disclosure from host memory.
If Mitigated
If proper network segmentation and access controls are in place, impact is limited to the specific QEMU instance and potentially adjacent VMs on same host.
🎯 Exploit Status
Exploitation requires access to a guest VM with ability to send SCSI commands. Public PoC exists in references.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: QEMU 8.2.0 and later
Vendor Advisory: https://gitlab.com/qemu-project/qemu/-/issues/1810
Restart Required: Yes
Instructions:
1. Update QEMU to version 8.2.0 or later. 2. Stop all QEMU instances. 3. Install updated package from your distribution's repository or compile from source. 4. Restart QEMU instances.
🔧 Temporary Workarounds
Disable SCSI emulation
allRemove or disable ESP SCSI controller from QEMU configurations
Check QEMU command line or config files for '-device esp' or similar SCSI device options and remove them
Network segmentation
allIsolate QEMU hosts from critical networks and implement strict access controls
🧯 If You Can't Patch
- Disable SCSI device emulation in all QEMU configurations
- Implement strict network segmentation and monitor for unusual SCSI command patterns
🔍 How to Verify
Check if Vulnerable:
Check QEMU version with 'qemu-system-x86_64 --version' or equivalent for your architecture. If version is below 8.2.0 and SCSI emulation is enabled, system is vulnerable.
Check Version:
qemu-system-x86_64 --version | head -1
Verify Fix Applied:
Verify QEMU version is 8.2.0 or later with 'qemu-system-x86_64 --version' and confirm no SCSI devices are configured unless necessary.
📡 Detection & Monitoring
Log Indicators:
- QEMU process crashes
- Kernel logs showing segmentation faults in QEMU
- Unusual SCSI command patterns in QEMU logs
Network Indicators:
- Unexpected SCSI command traffic to/from QEMU hosts
SIEM Query:
process_name:"qemu-system" AND (event_type:crash OR error_message:"segmentation fault")
🔗 References
- https://gist.github.com/1047524396/5ce07b9d387095c276b1cd234ae5615e
- https://github.com/qemu/qemu/commit/77668e4b9bca03a856c27ba899a2513ddf52bb52
- https://gitlab.com/qemu-project/qemu/-/issues/1810
- https://security.netapp.com/advisory/ntap-20240510-0012/
- https://gist.github.com/1047524396/5ce07b9d387095c276b1cd234ae5615e
- https://github.com/qemu/qemu/commit/77668e4b9bca03a856c27ba899a2513ddf52bb52
- https://gitlab.com/qemu-project/qemu/-/issues/1810
- https://security.netapp.com/advisory/ntap-20240510-0012/