CVE-2025-58147 Overview
CVE-2025-58147 is an out-of-bounds memory access vulnerability affecting Xen hypervisor's Viridian hypercall implementation. The vulnerability exists in the boundary checking logic when processing vCPU ID masks specified in hypercall inputs. Specifically, hypercalls using the HV_VP_SET Sparse format can cause vpmask_set() to write out of bounds when converting the bitmap to Xen's internal format.
This vulnerability is part of a series of related issues (including CVE-2025-58148) where Xen's boundary checking bugs across all three vCPU mask input formats can lead to out-of-bounds reads and writes during input processing.
Critical Impact
Network-accessible out-of-bounds write vulnerability in Xen hypervisor could allow unauthorized information disclosure and potential compromise of hypervisor integrity in virtualized environments.
Affected Products
- Xen Hypervisor (all versions with Viridian hypercall support)
- Systems running Xen with HyperV-compatible guest VMs
- Cloud and virtualization infrastructure utilizing Xen
Discovery Timeline
- 2025-10-31 - CVE-2025-58147 published to NVD
- 2026-01-14 - Last updated in NVD database
Technical Details for CVE-2025-58147
Vulnerability Analysis
The vulnerability resides in Xen's implementation of Viridian hypercalls, which provide compatibility with Microsoft HyperV interfaces. When guest VMs invoke certain hypercalls, they can specify a mask of vCPU IDs as input using one of three supported formats. The HV_VP_SET Sparse format, in particular, lacks proper boundary validation.
When processing these inputs, the vpmask_set() function converts the guest-provided bitmap to Xen's internal format. Due to insufficient boundary checking, a malicious or compromised guest VM can craft inputs that cause the function to write beyond allocated memory boundaries. This out-of-bounds write condition can lead to information disclosure from host memory.
Root Cause
The root cause is inadequate bounds checking in the Viridian hypercall handler code. When converting vCPU bitmaps from HV_VP_SET Sparse format to Xen's internal representation, the code fails to properly validate that the specified vCPU IDs fall within the allocated bounds of the target data structure. This allows guest-controlled input to influence memory operations outside intended boundaries.
Attack Vector
The attack vector is network-accessible without requiring authentication or user interaction. An attacker with control over a guest VM can exploit this vulnerability by:
- Crafting a malicious Viridian hypercall using the HV_VP_SET Sparse format
- Specifying vCPU ID values that exceed the expected boundaries
- Triggering the vpmask_set() function to perform out-of-bounds memory operations
- Potentially reading sensitive information from hypervisor memory
The vulnerability requires no privileges beyond the ability to execute hypercalls from within a guest VM, making it exploitable in multi-tenant cloud environments where guests from different security domains share the same hypervisor.
Detection Methods for CVE-2025-58147
Indicators of Compromise
- Unusual hypercall activity patterns from guest VMs, particularly HV_VP_SET operations
- Hypervisor memory corruption or unexpected behavior following Viridian hypercalls
- Guest VMs attempting to specify abnormally large vCPU ID values in hypercall parameters
- Xen hypervisor crashes or stability issues related to vCPU mask processing
Detection Strategies
- Monitor Xen hypervisor logs for hypercall failures or boundary violations
- Implement hypervisor-level auditing of Viridian hypercall invocations
- Deploy memory integrity monitoring to detect out-of-bounds access patterns
- Utilize SentinelOne Singularity platform for real-time hypervisor anomaly detection
Monitoring Recommendations
- Enable verbose logging for Viridian hypercall subsystem in Xen
- Configure alerts for abnormal vCPU mask values in hypercall parameters
- Monitor for guest VMs exhibiting unusual hypercall patterns or frequencies
- Implement network-level monitoring for signs of data exfiltration from hypervisor environments
How to Mitigate CVE-2025-58147
Immediate Actions Required
- Review the Xen Project Advisory XSA-475 for complete vulnerability details
- Assess exposure by identifying all Xen deployments with Viridian hypercall support enabled
- Prioritize patching for internet-facing or multi-tenant virtualization infrastructure
- Consider disabling Viridian hypercall support temporarily if not required for guest compatibility
Patch Information
Xen Project has released security patches addressing this vulnerability under advisory XSA-475. Administrators should apply the latest security updates from the Xen Project. Detailed patch information and updated packages are available through the official Xen security advisory and the OpenWall OSS Security Notice.
Workarounds
- Disable Viridian (HyperV) compatibility mode for Xen guests that do not require it by removing the viridian option from guest configurations
- Implement network segmentation to limit guest VM access to critical hypervisor interfaces
- Deploy additional monitoring and access controls around virtualization management infrastructure
- Consider migrating critical workloads to patched hypervisor instances until remediation is complete
# Disable Viridian support in Xen guest configuration
# Edit the guest configuration file (e.g., /etc/xen/guest.cfg)
# Remove or comment out Viridian-related options:
# viridian = 0
# viridian_time_ref_count = 0
# viridian_reference_tsc = 0
# Restart affected guest VMs after configuration changes
xl shutdown guest-name
xl create /etc/xen/guest-name.cfg
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

