Skip to content
Memory corruption Write-up Advanced

(CVE-2021-2321) Oracle VirtualBox E1000 BSS Out-Of-Bounds Read

The E1000 emulation in Oracle VirtualBox reads beyond the bounds of a buffer when processing transmit descriptors, because the driver can set the transfer tail register to a value that causes the device to process more descriptors than were provided. An attacker with control of the guest operating system could trigger an out-of-bounds read in the host process, potentially leading to a crash or information disclosure.

starlabs.sg

Published on starlabs.sg

When the e1000 driver is sending data to e1000 device, it will send frame by frame, there are context frame and data frame, usually one context frame followed by one or multiple data frames. We can prepare by setting TDH (Transfer Head), TDBAL (first 32 bit physical address of frames), TDBAH (last 32 bit physical…

The author, on starlabs.sg

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

Likely the emulated E1000 transmit path does not validate that the transfer tail register is within the range of descriptors actually provided by the guest, so it processes descriptors beyond the allocated buffer.

What the attacker needed

Control of the guest OS; ability to program the E1000 device

How it was found

  1. Set the TDH register to the desired transfer head.
  2. Set the TDBAL and TDBAH registers to the physical address of the frame buffer.
  3. Write the TDT register to trigger the transfer.
  4. The device calls e1kXmitPending and processes frames, leading to the out-of-bounds read.

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.

VirtualBox emulates a network card called E1000 so that a guest operating system can send network traffic. The guest tells the emulated card where its packets are stored and how many there are. A bug in that emulation lets the guest make the card read past the end of the memory it was given, which can crash VirtualBox or leak data from the host 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.