MOKSHA-2026-0032: Bidirectional Data Exfiltration via VM.xenstore_data Guest-to-XAPI-DB Sync

Advisory IDMOKSHA-2026-0032
Semantic IDXSD-3
Published2026-04-24
CVSS 3.17.1 High
CVSS 3.1 VectorAV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N
CVSS 4.08.3 High
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:H/SA:N
XAPI ObjectVM
XAPI Fieldxenstore_data
Entry Rolevm-admin
ResearcherJakob Wolffhechel, Moksha

Affected Products

VendorProductVersions
Citrix / Cloud Software GroupXenServer / Citrix Hypervisorall versions (shared XAPI codebase)
VatesXCP-ng8.3.0

Summary

The VM.xenstore_data field in XAPI-based hypervisors (XenServer, XCP-ng) creates a bidirectional data channel between guest domains and the XAPI management database. Guest writes to vm-data/ in xenstore are read by xenopsd during periodic state synchronization (xenops_server_xen.ml:3246-3248) and propagated into VM.xenstore_data in the XAPI database (xapi_xenops.ml:2431-2441). This is the only confirmed path where a guest domain can inject data into the XAPI database without any API authentication. Live-tested: guest-written data appears in the XAPI DB within 5 seconds. Any API consumer reading VM.xenstore_data receives attacker-injected values.

Vulnerability Description

The vm-data/ directory in xenstore is created with rwperm (read-write permissions for the guest domain) at domain.ml:604-624. This means the guest domain can write arbitrary keys and values under /local/domain/<domid>/vm-data/.

The reverse sync path:

  1. Guest domain writes to /local/domain/<domid>/vm-data/injected-key via xenstore-write
  2. xenopsd's event loop periodically reads vm-data/ from xenstore (xenops_server_xen.ml:3246-3248)
  3. xenopsd pushes the data to XAPI via the VM.set_xenstore_data internal call (xapi_xenops.ml:2431-2441)
  4. XAPI stores the guest-written data in VM.xenstore_data in the database
  5. Any API consumer reading VM.xenstore_data receives the guest-injected values

No authentication or integrity check occurs on the reverse path. The XAPI database trusts data originating from the guest domain.

Root Causes

  1. Bidirectional xenstore permissions. The vm-data/ directory is created with rwperm instead of roperm, allowing the guest to write back into a host-synced namespace.

  2. Unvalidated reverse sync. xenopsd's event loop propagates guest-written data into the XAPI database without any validation, sanitization, or origin marking.

  3. No origin tracking. The XAPI database does not distinguish between data written by an API user (vm-admin) and data written by the guest domain. Both appear identically in VM.xenstore_data.

  4. Trust assumption by API consumers. Any system reading VM.xenstore_data assumes the data was set by a trusted API user. Guest-injected data breaks this assumption.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
XAPI DB injection from guest Guest domain writes arbitrary data into the host management database Running VM with PV drivers or xenstore access Confirmed (live-tested)
Orchestrator poisoning Injected data consumed by management tools that trust XAPI metadata Guest domain, orchestrator reading xenstore_data Modeled
Cross-domain data exfiltration Guest uses vm-data writeback to signal data to a colluding API consumer Guest domain, colluding vm-admin or pool-operator Source-traced
Metadata integrity corruption Guest-written values corrupt metadata relied upon by backup and monitoring systems Running VM, systems consuming VM.xenstore_data Modeled

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Change vm-data permissions. Replace rwperm with roperm in domain.ml:604-624 to break the bidirectional sync. The guest should not be able to write to vm-data/ - this directory is a host-to-guest configuration channel, not a bidirectional communication bus.

Add origin tracking. If bidirectional sync is an intentional feature, mark guest-originated data with an origin flag so API consumers can distinguish it from administrator-set values.

Upstream patches exist. They are held privately pending coordinated disclosure.

Disclosure

Disclosure:

References

Credits

Discovered and reported by Jakob Wolffhechel, Moksha.

Jakob Wolffhechel · Moksha · Copenhagen
jakob@wolffhechel.dk · +45 3170 7337
Published 2026-04-24 08:00 CEST · cna.moksha.dk · shittrix.moksha.dk