MOKSHA-2026-0030: XML Injection in Template Provisioning via VM.other_config disks

Advisory IDMOKSHA-2026-0030
Semantic IDVOC-3
Published2026-04-24
CVSS 3.17.1 High
CVSS 3.1 VectorAV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
CVSS 4.07.1 High
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:L/SA:N
XAPI ObjectVM
XAPI Fieldother_config:disks
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 can inject crafted XML into VM.other_config:disks, which is parsed via Xml.parse_string during template provisioning at xapi_templates.ml:103-104. The parser expects a <provision><disk .../></provision> structure and extracts device, size, sr, bootable, and type attributes. By injecting malformed XML, an attacker can cause denial of service via parse errors. By injecting well-formed but malicious XML, an attacker can target specific SRs for VDI creation (SR targeting), specify extreme disk sizes to exhaust storage, or inject unexpected disk configurations. The key has no per-key RBAC protection beyond the vm-admin method-level check.

Vulnerability Description

VM.other_config is a Map(String, String) field writable by vm-admin. The disks key is parsed as raw XML during template clone and provisioning operations.

The code path:

  1. vm-admin calls VM.add_to_other_config(vm, "disks", "<malicious XML>")
  2. When the template is cloned or provisioned, XAPI reads and parses:
(* xapi_templates.ml:103-104 *)
disks_of_xml (Xml.parse_string (List.assoc disks_key other_config))
  1. disk_of_xml extracts attributes: device, size, sr, bootable, type
  2. XAPI creates VDIs according to the parsed specification

Attack Vectors

Vector Mechanism Impact
Malformed XML Xml.parse_string raises exception on invalid XML Denial of service - template provisioning fails
Extreme size size attribute set to very large value Storage exhaustion on target SR
SR targeting sr attribute set to specific SR UUID VDIs created on attacker-chosen SR (bypassing intended placement)
Disk count inflation Many <disk> elements in the XML Resource exhaustion via mass VDI creation

Root Causes

  1. Missing RBAC protection. VM.other_config has zero map_keys_roles entries for the disks key. vm-admin can write arbitrary values.

  2. Structural validation only. Xml.parse_string validates XML syntax but does not enforce a schema. Any well-formed XML is accepted. No validation on attribute values (size range, SR existence, device validity).

  3. Backend trust assumption. xapi_templates.ml assumes the disks key contains legitimate provisioning data set by a trusted template creator.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Provisioning DoS Template clone/provisioning fails with XML parse error vm-admin, template provisioning workflow Source-traced
Storage exhaustion VDIs with extreme sizes created on target SR vm-admin, template provisioning Source-traced
SR targeting VDIs created on attacker-chosen SR instead of intended SR vm-admin, knowledge of SR UUIDs Source-traced
Resource exhaustion Mass VDI creation via many <disk> elements vm-admin, template provisioning Modeled

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Schema validation. Validate the disks XML against a strict schema before parsing. Reject any XML that does not conform to the expected <provision><disk .../></provision> structure.

Attribute validation. Validate size against reasonable bounds. Validate sr against the set of SRs the user is authorized to access. Validate device against known device positions.

Add map_keys_roles. Protect disks in datamodel.ml at _R_POOL_ADMIN to prevent vm-admin from modifying template provisioning specifications.

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