MOKSHA-2026-0038: Provisioning Type Manipulation via SR.sm_config allocation

Advisory IDMOKSHA-2026-0038
Semantic IDSSMC-1
Published2026-04-24
CVSS 3.16.5 Medium
CVSS 3.1 VectorAV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H
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 ObjectSR
XAPI Fieldsm_config:allocation
Entry Rolepool-operator
ResearcherJakob Wolffhechel, Moksha

Affected Products

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

Summary

A pool-operator in XAPI-based hypervisors (XenServer, XCP-ng) can corrupt storage provisioning behavior by modifying or removing the allocation key in SR.sm_config after SR creation. The key controls whether LVHD SRs use thin or thick provisioning. Changing allocation from thin to thick (or removing the key) causes new VDIs to pre-allocate their full logical volume size instead of thin-provisioning. On overcommitted SRs, this causes immediate storage exhaustion with SR_BACKEND_FAILURE_44 errors. Restoring the key does not shrink already-inflated LVs - recovery requires storage migration (export, destroy, recreate, reimport). The sm_config field has zero map_keys_roles entries, and the allocation key is intended to be set once by the SM driver during SR.create but remains writable through the API.

Vulnerability Description

SR.sm_config is a Map(String, String) field writable by pool-operator. The allocation key is set by LVHDSR.create() during SR creation and controls the provisioning strategy for all subsequent VDI operations.

The code path:

  1. During SR.create, the SM driver sets sm_config:allocation = "thin" (or "thick")
  2. LVHDSR.__init__() reads PROVISIONING_TYPES = ["thin", "thick"] (LVHDSR.py:94)
  3. A pool-operator calls SR.remove_from_sm_config(sr, "allocation") or SR.add_to_sm_config(sr, "allocation", "thick")
  4. Next VDI creation reads the corrupted allocation value
  5. If changed from thin to thick: VDI LVs are created at full logical size instead of minimum allocation
  6. Overcommitted SRs immediately fail with space exhaustion

Live-tested results:

Root Causes

  1. Missing field immutability. SR.sm_config is qualifier:RW despite containing keys that should be immutable after driver initialization. The allocation key is set by the SM driver during SR.create but is modifiable by any pool-operator at any time.

  2. Missing RBAC protection. SR.sm_config has zero map_keys_roles entries. Every key is writable by pool-operator.

  3. No write-time validation. XAPI does not validate allocation against PROVISIONING_TYPES. Any string is accepted, including empty string and non-existent values.

  4. Irreversible damage. LVs inflated under thick mode do not shrink when the key is restored. The damage requires storage migration to remediate.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Thin-to-thick corruption VDIs pre-allocate full size, exhausting overcommitted SR pool-operator, thin-provisioned LVHD SR Confirmed (live-tested, 18/18 PASS)
Allocation key removal Driver falls back to default behavior, disrupting provisioning pool-operator, LVHD SR Confirmed (live-tested)
Silent storage exhaustion SR fills during normal VDI operations after corruption pool-operator, overcommitted thin SR Confirmed (live-tested)
BOC-1 chain vm-admin uses BOC-1 S3 to self-grant pool-operator, then corrupts allocation vm-admin, BOC-1 + LVHD SR Source-traced

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Enforce sm_config immutability. Once set by the SM driver during SR.create, driver-written keys should not be modifiable via the API. Implement a StaticRO equivalent for driver-set keys in sm_config.

Add map_keys_roles. Protect all driver-written keys (allocation, use_vhd, targetIQN, etc.) at _R_LOCAL_ROOT_ONLY in datamodel.ml.

Validate allocation. At write time, validate the value against PROVISIONING_TYPES (["thin", "thick"]). Reject any other value.

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