GHSL-2021-054_057: Code execution outside the virtualized guest in hyperkit - CVE-2021-32843, CVE-2021-32844, CVE-2021-32845, CVE-2021-32846
Hyperkit, a hypervisor, contained multiple vulnerabilities in its virtio device emulation where a malicious guest could trigger null function pointer dereferences or use uninitialized memory, leading to host crashes and potentially memory corruption. An attacker controlling the guest could cause a denial of service on the host and, under certain circumstances, execute code outside the virtualized guest.
Originally disclosed on GitHub Security Lab
A malicious guest can trigger vulnerabilities in the host by abusing certain drivers that may lead to code execution outside the virtualized guest.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The virtio device emulation code failed to check for null function pointers and return values from queue operations, leading to null pointer dereferences and use of uninitialized memory.
Impact
This issue may lead to a guest crashing the host causing a denial of service and under certain circumstance memory corruption.
What the attacker needed
Control over the guest kernel; hyperkit with vtrnd or virtio-sock device
The fix
The issues were fixed by the maintainers.
How it was found
- Boot hyperkit with the vtrnd device enabled (e.g., -s 5,virtio-rnd).
- Run a malicious guest kernel that performs an I/O port read from the device's configuration space.
- The host dereferences a null function pointer and crashes.
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 report has not been written yet. The Original tab links to the source.
Hyperkit is software that lets you run virtual machines on a Mac. The virtual machine (guest) talks to virtual devices like a random number generator. The code handling these devices had bugs: it sometimes called a function that didn't exist, or used memory that wasn't set up properly. A malicious guest could exploit these bugs to crash the host computer or possibly run its own code on the host.
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.