
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-58151 is a Time-of-Check Time-of-Use (TOCTOU) race condition vulnerability in varstored, a component of the Xapi toolstack responsible for handling UEFI Variables for virtual machines. The flaw arises from insufficient compiler barriers in the shared memory buffer between varstored and OVMF (Open Virtual Machine Firmware), allowing an attacker with kernel-level access inside a VM to control an index used in a jump table and achieve arbitrary code execution within varstored. All versions of varstored are potentially affected; only x86 HVM guests configured as UEFI VMs (with firmware=uefi in HVM-boot-params) are exploitable — x86 PV guests are not. The vulnerability was disclosed publicly on January 27, 2026 via the Xen Security Advisory XSA-478, and carries a CVSS v4.0 base score of 9.4 (Critical) (GitHub Advisory, Xen OSS-Sec).
The root cause is classified as CWE-367 (Time-of-Check Time-of-Use Race Condition). varstored maps a shared buffer prepared by OVMF inside the guest VM; without adequate compiler barriers (e.g., volatile qualifiers or memory fences), the compiler may optimize reads from this shared buffer, causing varstored to use a value that the guest has modified between the check and the use. In a default build, this TOCTOU window allows a malicious guest kernel to manipulate an index into a jump table within varstored, redirecting control flow to attacker-controlled code. The exact exploitable behavior is compiler-dependent, but default build settings are confirmed vulnerable. The issue was discovered by Teddy Astie of Vates and addressed via patch xsa478.patch (Xen OSS-Sec, GitHub Advisory).
Successful exploitation allows an attacker with kernel-level access inside a UEFI-configured HVM guest to escalate privileges by gaining arbitrary code execution within varstored, which runs in the host's user space as part of the Xapi toolstack. This constitutes a guest-to-host escape scenario, with high impact on confidentiality, integrity, and availability of both the vulnerable system (varstored) and subsequent systems (the hypervisor host and potentially other co-hosted VMs). An attacker could read sensitive UEFI variable data from other VMs, tamper with firmware-level configurations, or disrupt the availability of the virtualization infrastructure (Xen OSS-Sec, GitHub Advisory).
firmware=uefi in HVM-boot-params), as PV guests and BIOS-mode guests are not vulnerable.varstored process on the Xen host.The Xen Project has released patch xsa478.patch (SHA256: 401679429e22e202fecf418c5100144ea0ee1cca3643f09960107cf3d88821db) which resolves the issue by adding proper compiler barriers to the shared buffer handling in varstored. The advisory explicitly states there are no mitigations short of applying the patch. Administrators should apply the patch to varstored immediately, prioritizing systems where untrusted users have access to UEFI HVM guests. As a secondary measure, consider auditing which VMs are configured with firmware=uefi and restricting guest kernel access where possible (Xen OSS-Sec, GitHub Advisory).
The vulnerability was discovered by Teddy Astie of Vates and responsibly disclosed to the Xen Project Security Team prior to public release (Xen OSS-Sec). The advisory was noted on social media platforms including Bluesky and Mastodon/infosec.exchange shortly after disclosure. The Canadian Centre for Cyber Security (CCCS) issued a related advisory referencing the Citrix/Xen ecosystem vulnerabilities around the same period.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."