freenode
Databases & Infrastructure

QEMU NBD client leaked host heap into guest disk reads

CVE-2026-126657 let a malicious server omit structured read chunks so guests saw uninitialized QEMU memory, and sometimes different bytes on each read.

QEMU's NBD client could present uninitialized host memory to a guest as legitimate disk data when a malicious server sent incomplete structured read replies. The flaw, CVE-2026-126657, is fixed in patches Eric Blake prepared for the 11.2 release.

NBD lets a server that has negotiated structured replies return the pieces of a read in any order. The client must reassemble those chunks into the buffer for the request. The protocol says the server must cover the whole region, but it leaves the client to check that the chunks actually do so, and it leaves the result unspecified if they do not. QEMU never made that check. Since structured reads were added, a server that omitted chunks, or that wrote the same part of the buffer more than once, caused the guest to see whatever was already sitting in QEMU's heap and to treat it as data from the server.

A proof of concept reported by Feifan Qian showed a small leak from a qemu-kvm process whose allocator had been told to fill memory with a known pattern. That is enough to show a hostile server can push other, unscrubbed heap contents out to the guest, where they may make later attacks on QEMU easier.

The guest cannot tell that a reply was short. Reading the same part of the disk again can return different bytes as QEMU's heap changes between those reads, so an attacker can provoke a quiet form of data corruption without controlling either the guest's read pattern or the heap itself. Blake also noted a multi-tenant angle: a guest the attacker already controls, using a disk backed by an NBD server the attacker supplies, could try to exfiltrate unrelated information learned from other guests on the same host. Process isolation of heap contents limits that, but does not remove the path.

QEMU recommends that NBD client connections use TLS and x509 certificates so they are not pointed at untrusted servers. The fix stops the client from exposing uninitialized memory when a server's structured read does not actually cover the region the guest asked for.