/

CVE-2026-27211

Severity:

CRITICAL RISK

(10.0)

Improper File Access Control via Path Handling

CVE-2026-27211

Analyzed

Vulnerability type

Category:

Improper File Access Control via Path Handling

CWE:

CWE-73

Impact:

Arbitrary Host File Exfiltration (Guest-to-Host Information Disclosure)

Severity:

CRITICAL RISK

(10.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/cloud-hypervisor/cloud-hypervisor/commit/081a6ebb5184228ff348601502258f3f72bd8b43
github.comgithub.com/cloud-hypervisor/cloud-hypervisor/commit/509832298b6865365b00bda88722e76e41ce7f41
github.comgithub.com/cloud-hypervisor/cloud-hypervisor/commit/a63315df54e06f6ec867f17b63076c266e2d8648
github.comgithub.com/cloud-hypervisor/cloud-hypervisor/commit/cb495959a8bea1b56e8fc82d15ba527a0e7fcf3c
github.comgithub.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v50.1
github.comgithub.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v51.0
github.comgithub.com/cloud-hypervisor/cloud-hypervisor/security/advisories/GHSA-jmr4-g2hv-mjj6

Frequently asked

questions

Exploitability is high wherever guests have writable access to the backing raw image or where images can be sourced from untrusted origins. In such setups, a single compromised or malicious VM can craft disk headers that cause the host hypervisor to expose sensitive host files. Deployments using only trusted, read-only images and strong file access restrictions significantly reduce this risk.

An attacker needs the ability to control the content of the disk header used for auto-detection. This typically means:

  • write access from inside the guest to the virtual disk image (persisting changes), or
  • control over the supply chain that provides the image to the hypervisor.

No direct access to the host is required; the attack is driven entirely from within the guest VM.

The most robust fix pattern combines:

  • enforcing strict confinement of host file access for the hypervisor (using sandboxing and least-privilege accounts),
  • ensuring disk format handling does not trust guest-controlled headers to reference arbitrary host paths, and
  • binding backing file resolution to predefined directories or storage mechanisms that cannot be influenced by guest data.

Together, these ensure that even if disk parsing is attacked, the hypervisor cannot open sensitive host files.

Prevention focuses on recognizing that any metadata derived from guest-visible media is untrusted:

  • Treat disk headers and image metadata as attacker-controlled input, and avoid using them directly for host file path decisions.
  • Implement strict path validation and directory confinement for all file operations in hypervisors and storage backends.
  • Use strong sandboxing for hypervisor processes and apply least-privilege principles to minimize the impact of parsing logic mistakes.
  • Incorporate security reviews and automated checks for file-path usage patterns into the development lifecycle of virtualization components.
Find out what's already
exploitable in your codebase.