Summary
Cloud Hypervisor versions 34.0 through 50.0 contain an arbitrary host file exfiltration vulnerability in the virtio-block implementation when disks are backed by raw images and image format auto-detection is enabled.
A malicious guest can rewrite its block device header to masquerade as a QCOW2 image that references sensitive host file paths, causing the hypervisor to serve host file contents back to the guest during subsequent boots or disk scans when the backing image is writable or comes from an untrusted origin.
Affected context
This vulnerability affects Cloud Hypervisor deployments using:
- virtio-block devices backed by raw disk images
- image format auto-detection that inspects disk headers
- backing images that are either:
- writable by the guest, or
- sourced from untrusted or partially trusted origins
The issue is exercised when the hypervisor re-reads disk headers during VM boot or disk scan. Setups that rely solely on trusted, read-only backing images and tightly restricted host file access are typically not exposed to this behavior.
Exploit preconditions
- Attack surface: Guest VM to host hypervisor via virtio-block disk handling.
- Required access: Ability for a guest to:
- write to the beginning (header area) of its virtual disk image; or
- cause the hypervisor to use an image originating from an untrusted source that may already contain a crafted header.
- Trigger point: Any operation where the hypervisor performs image format auto-detection or disk scanning:
- VM boot or reboot initiated from within the guest
- Hypervisor-initiated disk scan without restarting the Cloud Hypervisor process
- Why exploitation is possible: The auto-detection logic trusts disk headers in raw images and can interpret a guest-controllable header as a QCOW2 structure that references arbitrary host file paths. The hypervisor then opens and maps those host files as if they were backing images, exposing their contents to the guest within the virtual disk view, constrained mainly by the Cloud Hypervisor process privileges on the host.
Why this happens
The core issue stems from improper handling of file paths and backing file references during disk image format auto-detection and parsing.
When presented with a raw disk image, the hypervisor inspects the initial bytes to determine if the content represents a more complex format such as QCOW2. In affected versions, this detection trusts the on-disk header enough to:
- treat guest-controlled bytes as a valid QCOW2 structure, and
- follow backing file paths embedded in this structure on the host filesystem.
This behavior maps to CWE-73: External Control of File Name or Path, where attacker-controlled input (the disk header and embedded paths) influences the selection of host files opened by a privileged process. The disk auto-detection path acts as an implicit deserialization of file metadata without sufficiently constraining or validating backing file references against safe directories, trust boundaries, or expected formats. Because the guest can rewrite raw disk headers or supply untrusted images, it indirectly controls the host-side file paths the hypervisor opens and exposes as disk contents.
Potential impact
- Exfiltration of sensitive host files accessible to the Cloud Hypervisor process (e.g., configuration files, logs, or other data on the same filesystem).
- Disclosure of secrets stored on the host, such as API keys, tokens, or credentials, if they are readable by the hypervisor process.
- Leakage of other tenants' data when multiple guests share a host and sensitive files are readable under the same privileges.
- Facilitation of further attacks through access to host configuration details, environment information, or internal network data captured in logs.
- Undermining of isolation guarantees between guest VMs and the host, eroding trust in the virtualization boundary.
General mitigation guidance
Effective mitigation focuses on constraining guest influence over disk metadata and limiting which host resources the hypervisor can open:
- Restrict guest-writeable backing images:
- Prefer read-only or copy-on-write images that the guest cannot directly modify at the header level.
- Avoid configurations where guest activity can persistently alter raw image headers used for format detection.
- Constrain image sources and trust boundaries:
- Treat external or dynamically supplied images as untrusted until validated.
- Use controlled provisioning pipelines to ensure disk images are generated and signed by trusted systems.
- Harden file access policies for the hypervisor process:
- Run the Cloud Hypervisor process under an account with minimal filesystem privileges (least privilege).
- Use sandboxing technologies (e.g., Landlock, seccomp, MAC systems) to restrict which directories and files the process can access, independent of disk metadata.
- Apply chroot-like or namespace-based isolation so that even if paths are followed, they reference only a constrained subset of files intended for VM backing.
- Constrain or validate backing file references:
- Implement strict allowlists for directories from which backing files may be opened.
- Normalize and validate file paths before use, rejecting any references that escape predefined storage roots or contain unexpected patterns.
- Reduce reliance on auto-detection where possible:
- Prefer explicit configuration of disk formats over automatic format detection when you control the environment and image lifecycle.
These patterns aim to ensure that guest-controlled bytes cannot arbitrarily influence which host files are opened, and that the hypervisor has minimal access to sensitive host data even if parsing logic is imperfect.
How teams detect issues like this
Organizations can look for this class of vulnerability and its symptoms through multiple angles:
- Static and code review-based detection:
- Review hypervisor and storage backend code for:
- auto-detection logic that infers disk format from mutable media headers,
- functions that open files based on metadata parsed from guest-controlled data,
- use of unconstrained or unvalidated host file paths in backing file resolution.
- Establish secure coding guidelines that forbid directly using guest-influenced paths without confinement (e.g., enforce directory allowlists and path normalization).
- Configure static analysis tools to flag path usages where the source of the path originates from untrusted data structures (such as disk headers, image metadata, or guest-supplied configuration).
- Policy and configuration auditing:
- Periodically audit hypervisor runtime configuration to ensure:
- disks are backed by read-only images where feasible,
- sandbox profiles (Landlock, SELinux, AppArmor, or similar) restrict file access to expected directories,
- auto-detection features are explicitly controlled and documented.
- Monitor orchestration or management plane definitions to detect VMs configured with raw images that are writable and untrusted.
- Runtime and behavioral monitoring:
- Capture and analyze system call traces from hypervisor processes to detect unexpected file-open patterns, especially reads from sensitive paths not intended as backing storage.
- Use host-based intrusion detection systems to alert on hypervisor processes accessing unusual files or directories.
- CI/CD integration:
- Integrate automated checks into build pipelines to scan for risky file-handling patterns and to validate that new storage features enforce path confinement.

