MOKSHA-2026-0031: Guest Agent Poisoning via VM.xenstore_data vm-data Injection

Advisory IDMOKSHA-2026-0031
Semantic IDXSD-1
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

A vm-admin in XAPI-based hypervisors (XenServer, XCP-ng) can inject arbitrary key-value pairs into a guest domain's xenstore vm-data/ directory by writing to VM.xenstore_data. The guest OS and guest agents read this directory as trusted hypervisor configuration. There is no mechanism for the guest to distinguish legitimate hypervisor-provided data from attacker-injected data. Guest agents that consume xenstore configuration - server endpoints, update sources, monitoring targets - are directed to attacker-controlled infrastructure. The field has zero per-key RBAC protection, and the only filtering is a weak prefix check in xenopsd that permits all keys starting with vm-data/.

Vulnerability Description

VM.xenstore_data is a Map(String, String) field writable by vm-admin. Values are written directly into the guest domain's xenstore at /local/domain/<domid>/vm-data/. The vm-data directory is created with read-write permissions (rwperm) for the guest domain.

The code path:

  1. vm-admin calls VM.add_to_xenstore_data(vm, "vm-data/config-endpoint", "https://attacker.example.com")
  2. XAPI stores the value in the database with zero validation (message_forwarding.ml:2092-2099)
  3. XAPI passes the map verbatim to xenopsd (xapi_xenops.ml:1355)
  4. xenopsd applies a prefix filter (domain.ml:164-170) - only vm-data/ and FIST/ prefixes are allowed
  5. Filtered keys are written to /local/domain/<domid>/vm-data/ with rwperm (domain.ml:604-624)
  6. Guest agents read the injected data as trusted hypervisor configuration

The prefix filter is the only security control in the entire chain. It performs no value validation, no key depth restriction, and no length limits.

Root Causes

  1. Missing RBAC protection. VM.xenstore_data has zero map_keys_roles entries in datamodel_vm.ml. Every key is writable by vm-admin via add_to_xenstore_data or set_xenstore_data.

  2. Missing value validation. No validation occurs at any stage - XAPI, xenopsd, or xenstore. Arbitrary binary data is accepted as values.

  3. Trust boundary violation. Guest agents treat vm-data/ as a trusted hypervisor configuration channel. There is no authentication or integrity verification on xenstore entries.

  4. set_xenstore_data bypass. The set_xenstore_data method replaces the entire map atomically, bypassing any future per-key checks.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Server endpoint redirection Guest agent connects to attacker-controlled server for updates, telemetry, or configuration vm-admin, guest running PV agents Source-traced
Configuration injection Guest behavior modified via injected configuration keys (network settings, service endpoints) vm-admin, guest agents consuming vm-data Source-traced
Update source poisoning Guest agent downloads updates from attacker-controlled source vm-admin, guest agent with update functionality Modeled
Multi-tenant trust confusion In delegated environments, vm-admin modifies guest configuration across trust boundaries vm-admin, multi-tenant deployment with delegated VM management Modeled

Detection

No reliable guest-side detection exists. The guest cannot distinguish injected data from legitimate hypervisor configuration.

Remediation

Short-Term Mitigations

Long-Term Fix

Add map_keys_roles. Protect infrastructure-critical vm-data/ key prefixes in datamodel_vm.ml at _R_POOL_ADMIN to prevent vm-admin from injecting guest configuration.

Guest-side integrity verification. Guest agents should not blindly trust xenstore data. Implement signature verification or out-of-band validation for configuration consumed from vm-data/.

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