MOKSHA-2026-0068: Guest Xenstore Data Injection via VM.platform Map

Advisory IDMOKSHA-2026-0068
Semantic IDPLAT-4
Published2026-04-24
CVSS 3.15.3 Medium
CVSS 3.1 VectorAV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
CVSS 4.05.3 Medium
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
XAPI ObjectVM
XAPI Fieldplatform
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 VM.platform, and the entire platform map is written to guest-visible xenstore at /local/domain/<domid>/platform/ during domain creation. The bulk write at domain.ml:486 dumps all platform keys - including attacker-injected keys alongside legitimate hypervisor configuration - into guest xenstore without filtering. Guest operating systems and guest agents that read the platform xenstore path treat all entries as trusted hypervisor configuration. There is no mechanism for the guest to distinguish legitimate keys from injected keys. The VM.platform field has zero map_keys_roles entries.

Vulnerability Description

VM.platform is a Map(String, String) field defined at datamodel_vm.ml:2717-2720 with no ~map_keys_roles parameter. All keys are writable by vm-admin.

During domain creation, xenopsd writes the entire platform map to guest xenstore:

(* domain.ml:486 *)
xs.Xs.writev (dom_path ^ "/platform") vm_info.platformdata ;

This is a bulk write operation that dumps every key-value pair in the platform map into the guest xenstore path /local/domain/<domid>/platform/. Live xenstore examination confirms all platform keys are visible to the guest, including security-sensitive keys like featureset, nx, pae, and device_id.

The attack:

  1. vm-admin injects arbitrary keys: VM.add_to_platform(vm, "custom-config-url", "https://evil.example.com/config")
  2. VM starts - domain creation writes all platform keys to guest xenstore
  3. Guest agent reads /local/domain/<domid>/platform/custom-config-url
  4. Guest agent treats the value as hypervisor-provided configuration

The guest has no cryptographic or structural mechanism to verify the provenance of platform keys. All entries under /local/domain/<domid>/platform/ are equally trusted.

Root Causes

  1. Unfiltered bulk write. The entire platform map is dumped to guest xenstore without any key filtering. Both legitimate hypervisor configuration and arbitrary user-injected keys are written identically.

  2. Missing RBAC protection. VM.platform has zero map_keys_roles entries. Unlike VM.other_config which restricts pci, folder, and XenCenter.CustomFields.*, the platform field has no per-key access control.

  3. No guest-visible key whitelist. There is no allowlist defining which platform keys are intended to be guest-visible. All keys are exposed, including security-critical ones.

  4. No write-time validation. Platform keys are validated only at VM start time via Vm_platform.sanity_check, not when they are written. The sanity_check is a key-name allowlist, not a value validator.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Arbitrary key injection to guest Guest reads attacker-controlled values from platform xenstore vm-admin, VM start Confirmed (live xenstore dump)
Guest agent configuration hijack Guest agent uses injected platform key for auto-configuration vm-admin, guest agent reading platform keys Modeled
Infrastructure metadata exposure Legitimate platform keys (featureset, device_id) visible to guest Default configuration Confirmed (live xenstore dump)
BOC-1 chain Pool-wide injection of arbitrary platform keys across all VMs vm-admin, BOC-1 Source-traced

Chaining Analysis

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Filter platformdata before xenstore write. Define a whitelist of keys intended to be guest-visible and filter the platform map before the bulk write at domain.ml:486. Do not dump the entire map to guest xenstore.

Add map_keys_roles to VM.platform. Restrict security-critical keys to _R_POOL_ADMIN. Allow vm-admin to set only cosmetic keys (e.g., timeoffset, vga).

Add write-time validation. Validate platform key values when they are set, not only when the VM starts.

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