CVE-2025-58143 Overview
CVE-2025-58143 is a critical race condition vulnerability in the Xen hypervisor's viridian code that handles guest memory page mapping. This vulnerability is part of a set of related issues (including CVE-2025-27466 and CVE-2025-58142) affecting how guest memory pages are handled and accessed within Xen's viridian implementation.
The specific vulnerability exists in the mapping of the reference TSC (Time Stamp Counter) page, where a malicious guest can exploit a race condition to cause Xen to free a page while it is still present in the guest physical to machine (p2m) page tables. This can lead to use-after-free conditions, memory corruption, and potential privilege escalation or hypervisor escape scenarios.
Critical Impact
A malicious guest VM can exploit this race condition to manipulate hypervisor memory management, potentially leading to privilege escalation, denial of service, or hypervisor compromise affecting all hosted virtual machines.
Affected Products
- Xen Hypervisor (x86 architecture)
- Xen-based virtualization platforms using viridian enlightenments
- Cloud and enterprise environments running Xen with Windows guests using Hyper-V compatible interfaces
Discovery Timeline
- 2025-09-11 - CVE CVE-2025-58143 published to NVD
- 2025-11-04 - Last updated in NVD database
Technical Details for CVE-2025-58143
Vulnerability Analysis
This vulnerability is classified as a Race Condition (CWE-366), specifically a Time-of-Check Time-of-Use (TOCTOU) issue in the Xen hypervisor's viridian code. The viridian interface provides Hyper-V compatible enlightenments to guest operating systems, allowing them to interact more efficiently with the hypervisor.
The vulnerability affects the reference TSC page mapping mechanism, which is used to provide high-precision timing information to guest VMs. When a guest requests mapping of the reference TSC page, a race condition exists between the page validation/mapping operations and subsequent memory management operations. An attacker can exploit this timing window to trigger a page free operation while the page reference remains in the guest's p2m tables.
This is one of three related vulnerabilities in the viridian code:
- CVE-2025-27466: NULL pointer dereference in reference TSC area updates
- CVE-2025-58142: NULL pointer dereference when delivering synthetic timer messages via unmapped SIM page
- CVE-2025-58143: Race condition in reference TSC page mapping (this vulnerability)
Root Cause
The root cause is improper synchronization in the viridian code's handling of reference TSC page mapping. The code fails to properly serialize access to the page mapping state, creating a window where:
- The hypervisor validates and begins mapping a page for the guest
- Before the operation completes atomically, another thread or operation path frees the page
- The page remains referenced in the p2m tables after being freed
- Subsequent accesses to this "stale" mapping can corrupt memory or cause other undefined behavior
The lack of proper locking or atomic operations around the complete map-and-reference cycle allows a carefully timed guest operation to exploit this race window.
Attack Vector
The attack can be initiated from within a guest VM, making it a guest-to-hypervisor attack vector. A malicious guest administrator or compromised guest can:
- Initiate reference TSC page mapping requests in rapid succession
- Simultaneously trigger operations that would cause page unmapping or freeing
- Win the race condition to leave a dangling reference in the p2m tables
- Use the dangling reference to access freed memory, potentially corrupting hypervisor state
The exploitation of this vulnerability could allow a malicious guest VM to escape its isolation boundaries, impact other guest VMs on the same host, or compromise the hypervisor itself. For more technical details, refer to the Xen Project Security Advisory XSA-472.
Detection Methods for CVE-2025-58143
Indicators of Compromise
- Unexpected hypervisor crashes or instability, particularly related to memory management operations
- Anomalous patterns in guest VM timing-related hypercalls, especially reference TSC page operations
- Memory corruption signatures in Xen crash dumps pointing to p2m table inconsistencies
- Guest VMs exhibiting unusual behavior around timing synchronization operations
Detection Strategies
- Monitor hypervisor logs for memory management errors or warnings related to p2m table operations
- Implement runtime integrity checking for critical hypervisor data structures
- Deploy host-based intrusion detection systems that can monitor for anomalous hypercall patterns
- Enable Xen debugging facilities to capture detailed traces of viridian-related operations during incident investigation
Monitoring Recommendations
- Enable comprehensive Xen event logging, particularly for viridian and memory management subsystems
- Configure alerting for hypervisor stability events such as unexpected domain crashes or memory errors
- Monitor guest VM behavior for rapid, repetitive hypercall patterns that may indicate exploitation attempts
- Implement centralized log collection for Xen hosts to enable correlation of suspicious activities across infrastructure
How to Mitigate CVE-2025-58143
Immediate Actions Required
- Review the Xen Project Security Advisory XSA-472 for detailed patch information
- Apply vendor-provided security patches for Xen hypervisor immediately
- Prioritize patching of production systems hosting sensitive or multi-tenant workloads
- Consider temporarily disabling viridian enlightenments for untrusted guest VMs if patching cannot be performed immediately
Patch Information
Security patches addressing this vulnerability are available through the Xen Project. The advisory XSA-472 covers this vulnerability along with the related CVE-2025-27466 and CVE-2025-58142 issues. Administrators should apply all patches from this advisory to ensure complete remediation.
Consult the Xen Project Security Advisory for specific patch versions and commit hashes applicable to your Xen deployment. Additional discussion and context is available on the OpenWall OSS-Security Mailing List.
Workarounds
- Disable viridian enlightenments for untrusted or high-risk guest VMs by setting viridian=0 in guest domain configuration
- Restrict guest VM creation and management to trusted administrators only
- Implement network segmentation to limit the impact of potential hypervisor compromise
- Consider migrating critical workloads to patched hosts while updates are being rolled out
# Example: Disable viridian enlightenments in Xen domain configuration
# Add to /etc/xen/vm-config.cfg or domain configuration file
viridian = 0
# Alternatively, disable specific viridian features if full disablement impacts performance
# Consult Xen documentation for granular control options
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


