Skip to content
Memory corruption Write-up Advanced

Exploiting a Heap Overflow in VMware

A heap overflow in VMware's DnD/CP protocol allowed a guest user to overwrite heap memory on the host, leading to code execution. The vulnerability was in the reassembly of fragmented packets where the size check was only valid for the first packet.

acez.re

Published on acez.re

History

The author, on acez.re

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 code only validates the total size against the payload offset and size for the first packet, but for subsequent packets it trusts the size field from the packet header without verifying it matches the originally allocated buffer size.

Impact

A guest user could execute arbitrary code on the host, but the exploit's reliability was limited by the Windows Low Fragmented Heap, with a success probability of 60-80%.

What the attacker needed

Guest access to VMware; ability to send RPCI commands; non-admin account in guest

The fix

The vulnerability was fixed by VMware in version 12.5.4, as indicated by the advisory.

How it was found

  1. Set DnD and Copy/Paste protocol versions to 3 using RPCI commands.
  2. Send a first fragment with a small binarySize and payloadOffset 0.
  3. Send a second fragment with a larger binarySize and a payloadOffset matching the expected offset.
  4. The host allocates a buffer based on the first fragment's binarySize and then copies the second fragment's payload beyond the buffer, causing a 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.

This report describes a bug in VMware that lets a program inside a virtual machine take control of the computer running VMware. The bug is a heap overflow, which means writing more data than a buffer can hold, and it happens because the software trusts the size field in later packets without checking it against the first packet.

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.