Heap overflow in QEMU PCNET controller, allowing guest-host escape
The QEMU PCNET network device emulation has a heap overflow when processing split transmit frames, allowing a guest to overwrite host memory. An attacker with access to the emulated device can take control of the host QEMU process.
xenbits.xen.org
Published on xenbits.xen.org
CVE(s) | CVE-2015-3209 |
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The PCNET emulation does not properly check the total length when combining multiple transmit frame descriptors, leading to a heap buffer overflow.
Impact
A guest with access to an emulated PCNET device can take over the QEMU process, elevating its privilege to that of the QEMU process; systems using stubdomains or not using PCNET are not vulnerable.
What the attacker needed
Guest access to emulated PCNET device; PCNET configured for split-frame processing; no stubdomain
The fix
The issue was fixed by applying the provided patches.
How it was found
- Configure the PCNET controller via the XMTRL CSR to support split-frame processing.
- Send a first transmit frame descriptor marked as TXSTATUS_STARTPACKET but not TXSTATUS_ENDPACKET, with a frame of length 4096.
- Send a second transmit frame descriptor that sets TXSTATUS_DEVICEOWNS and does not set TXSTATUS_STARTPACKET, containing N bytes.
- The second frame is appended to the 4096-byte buffer, causing an N-byte heap overflow.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A guest virtual machine can send specially crafted network packets to the emulated PCNET network card. Because of a bug in how the emulator handles split packets, it writes more data than the buffer can hold, corrupting memory in the host process. This lets the guest take over the host QEMU process.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.