MOKSHA-2026-0025: Storage Protocol Metadata Poisoning via SR.sm_config (targetIQN/target/LUNid)

Advisory IDMOKSHA-2026-0025
Semantic IDSSMC-3
Published2026-04-24
CVSS 3.17.2 High
CVSS 3.1 VectorAV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H
CVSS 4.08.4 High
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:H/VA:H/SC:N/SI:H/SA:N
XAPI ObjectSR
XAPI Fieldsm_config:targetIQN, sm_config:target, sm_config:LUNid
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 can corrupt storage protocol metadata by modifying targetIQN, target, datatype, or LUNid keys in SR.sm_config on iSCSI and HBA storage repositories. These keys are written by the SM driver during SR.create and read back during subsequent operations - but the field remains writable after creation. Modifying LUNid causes VDI operations to target the wrong LUN, enabling cross-SR data corruption. Modifying targetIQN or target causes SR misidentification and connection failures. This is an SR-level variant of the SMC-1 storage protocol injection - same architectural root cause, but at the SR level affecting all VDIs in the repository.

Vulnerability Description

SR.sm_config is a Map(String, String) field described as "SM dependent data" that serves as the primary configuration channel between XAPI and the SMAPIv1 storage driver framework. The field requires pool-operator to write and has zero map_keys_roles entries.

The data flow:

  1. SM driver writes targetIQN, target, datatype, LUNid during SR.create (e.g., BaseISCSI.py:507-513)
  2. Values are stored in the XAPI database
  3. On subsequent SR.load() / SR.attach(), the driver reads these keys back
  4. A pool-operator can modify the keys at any time via SR.set_sm_config or SR.add_to_sm_config
  5. The driver uses the modified values in storage protocol operations

Key-Specific Impacts

Key Impact
targetIQN SR targets wrong iSCSI initiator group - connection to wrong storage target
target Changes iSCSI target address - could redirect to attacker-controlled target
LUNid VDI operations target wrong LUN - cross-SR data corruption
datatype SR type misidentification during scans

Root Causes

  1. Missing immutability enforcement. SR.sm_config keys set by the SM driver during SR.create remain writable via the API after creation. No immutability mechanism exists.

  2. Missing RBAC protection. SR.sm_config has zero map_keys_roles entries. All driver-written keys are writable by pool-operator.

  3. Backend trust assumption. SM drivers assume sm_config values are authoritative and have not been tampered with since creation.

Affected Systems

Directly Affected

Storage Drivers Affected

Driver Keys Impact
BaseISCSI (lvmoiscsi) targetIQN, target, LUNid Target/LUN poisoning, cross-SR corruption
HBASR targetIQN, datatype, LUNid HBA type corruption, LUN mismatch

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
LUNid redirection VDI operations target wrong LUN - cross-SR data corruption pool-operator, iSCSI SR Source-traced
Target IQN manipulation SR connects to wrong iSCSI target group pool-operator, iSCSI SR Source-traced
Target address change SR redirected to different iSCSI target server pool-operator, iSCSI SR Source-traced
Via BOC-1 chain vm-admin escalates to pool-operator via BOC-1 S3, then corrupts SR metadata BOC-1 available Modeled (chained)

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 API. Implement a mechanism to distinguish driver-set keys from user-set keys.

Add map_keys_roles. Protect targetIQN, target, LUNid, datatype at _R_LOCAL_ROOT_ONLY.

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