DEV Community

Ioneyrezende
Ioneyrezende

Posted on

Inside CVE-2026-99312: how a stale KVM page-table pointer breaks host isolation

Inside CVE-2026-99312: how a stale KVM page-table pointer breaks host isolation

KVM normally turns a guest physical address into a host physical address through a nested page table. CVE-2026-99312 breaks that translation path on AMD hosts that allow nested virtualization. The flaw matters because the affected pointer belongs to the hypervisor, and the memory it can name may belong to the host kernel or another virtual machine.

Terra Security researcher Oren Yomtov found the issue through DigitalOcean's bug bounty program. Terra published a technical analysis on November 18, 2026, the same day the CVE record appeared. ThaiCERT rates the vulnerability CVSS v3.1 8.8. The reviewed sources contain no report of exploitation outside the research demonstrations.

Vulnerability overview

CVE-2026-99312 is a use-after-free of a nested page table pointer in KVM's AMD SVM code. It affects systems running a vulnerable Linux kernel on AMD processors with nested virtualization enabled. KVM, the hypervisor built into the Linux kernel, is the affected component.

The vulnerable code dates to a 2022 change for CVE-2022-3344. Terra says the defect remained in the kernel for just under four years because the earlier fix left one reset path incomplete. The practical scope depends on both kernel version and host configuration. An AMD system that does not expose nested virtualization did not meet the stated exploitation condition.

The translation boundary

A guest sees physical addresses that are private to the guest. The AMD processor uses KVM's nested page table, or NPT, to translate those addresses into host memory pages. KVM keeps the top of that table outside the guest's control and points the virtual CPU's VMCB at it through the nCR3 field, commonly called the NPT pointer.

That separation is the core of the virtualization boundary. The processor follows whichever page the NPT pointer names. It does not know whether KVM still owns that page. The host remains isolated only while the pointer refers to a live page table that the guest cannot modify.

INIT and the missed reset

When a guest runs its own nested virtual machine, KVM uses a different NPT pointer for the L2 context. A normal exit returns the outer virtual CPU to its own context. An INIT reset creates a special path. If the reset occurs while L2 is active with paging disabled, vulnerable KVM leaves the outer virtual CPU using stale MMU state.

The kernel fix says the MMU context must be reset unconditionally when KVM emulates INIT. KVM had treated some reset cases as safe because paging was already disabled. That reasoning missed the guest-mode part of the MMU role. The corrected path resets the context even when the old state looks similar, since rebuilding it is not expensive.

From freed page to forged page table

The stale pointer initially names a page KVM has freed. That page can be reused for ordinary memory work. In the demonstrated path, KVM reused it as a bottom-level NPT page for the guest. The processor still treated the same page as the top-level table.

That mismatch gave the attacker a page whose contents the guest could write, while the processor used it as part of the host-side translation walk. Terra used it to construct entries that selected other host physical pages. The next memory access could then land in host memory chosen by the guest.

This sequence explains why the flaw is more severe than an ordinary guest memory corruption. The guest does not need to guess a host kernel address from an arbitrary page. It gets a translation object that describes the host's physical address space.

Demonstrated impact

Terra mapped roughly 127 GB of host RAM read-only on a DigitalOcean droplet. The first proof read the host kernel version banner. The same research team demonstrated a write on its own bare-metal AMD server by changing 32 chosen bytes in a live host kernel page. No other customers were attached to that write test.

These results establish read and write access to host memory under the reported conditions. They do not prove arbitrary code execution, persistent access, or compromise of every host. They do show that a successful attacker could reach data outside the guest's assigned memory and alter host kernel memory.

Exposure and fixing

Fix releases include Linux 7.3.5, 6.18.64, and 6.12.118. Distributions may carry the same fix in their own kernel builds, so operators should follow the vendor's advisory rather than compare only a generic upstream version. The fix reached mainline as commit c7c288d178cb0b78d3464a616b16b1aa0b316049 and first appeared in 7.4-rc2.

A ZoomEye search for app="KVM" returned 10,738 product fingerprints. The CVE filter returned 0. The larger count is reported as exposure, but it does not prove that those systems use AMD processors, enable nested virtualization, run a vulnerable kernel, or were attacked.

Administrators should patch the host kernel, not only the guest. If a host cannot be patched promptly, Terra recommends disabling nested virtualization through the kvm_amd module. Validate the change on the running host and coordinate it with workloads that depend on nested virtual machines.

References

Top comments (0)