MOKSHA-2026-0066: Metadata Propagation via VDI Snapshot and Clone Operations

Advisory IDMOKSHA-2026-0066
Semantic IDVXD-3
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 ObjectVDI
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 poison VDI.xenstore_data before a snapshot or clone operation, causing malicious data to propagate to all descendant VDI records. The snapshot and clone code at xapi_vdi.ml:861-862 copies the parent VDI's xenstore_data to the new VDI record without re-validation. A single injection fans out through the entire snapshot/clone hierarchy - every descendant VDI inherits the poisoned metadata. The field has zero map_keys_roles restrictions and zero write-time validation.

Vulnerability Description

VDI snapshot and clone operations create new VDI records that inherit metadata from the parent. The code path at xapi_vdi.ml:861-862 explicitly copies xenstore_data:

Db.VDI.set_xenstore_data ~__context ~self:newvdi
  ~value:vdi_rec.API.vDI_xenstore_data ;

This is the intended behavior for SM-generated metadata - SCSI identity and storage type data should propagate to snapshots. The problem is that attacker-injected data is indistinguishable from SM-generated data and propagates identically.

The attack sequence:

  1. vm-admin injects poisoned data: VDI.add_to_xenstore_data(vdi, "storage-type", "attacker-controlled")
  2. vm-admin (or an automated process) triggers a snapshot or clone
  3. xapi_vdi.ml:861-862 copies xenstore_data including the poisoned entry to the new VDI
  4. The new VDI is snapshotted again - poisoned data copies to the next generation
  5. Each descendant in the snapshot tree inherits the original injection

The propagation is permanent. Even if the original poisoned entry is removed from the parent VDI, all existing descendants retain their copy. There is no mechanism to cascade a cleanup through the snapshot tree.

Root Causes

  1. Unconditional metadata copy. Snapshot and clone operations copy xenstore_data without filtering, validation, or re-generation from the SM driver.

  2. No provenance distinction. The copy operation cannot distinguish SM-generated entries from user-injected entries. Both propagate identically.

  3. Missing write-time validation. The parent VDI accepts any key-value pair without validation, ensuring the poisoned data exists to be copied.

  4. No cleanup cascade. Removing a key from a parent VDI does not propagate the removal to existing descendants.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Snapshot tree poisoning All descendants inherit injected metadata vm-admin, snapshot trigger Source-traced
Template poisoning VMs provisioned from template inherit poisoned VDI metadata vm-admin, template with snapshots Source-traced
Fan-out amplification Single injection multiplied across every snapshot/clone descendant vm-admin, active snapshot schedule Source-traced
Persistent contamination Removing injection from parent does not clean descendants vm-admin, existing snapshot tree Source-traced

Chaining Analysis

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Re-generate xenstore_data on snapshot/clone. Instead of copying the parent's database field, query the SM driver for fresh metadata during snapshot/clone. This eliminates propagation of user-injected data.

Add validation on copy. If direct SM query is not feasible, validate the copied xenstore_data against a whitelist of SM-known keys before storing in the new VDI record.

Restrict write access. Change the field write role to _R_POOL_ADMIN to prevent vm-admin from poisoning the source 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