MOKSHA-2026-0065: SCSI Identity Forgery in XAPI Database via VDI.xenstore_data

Advisory IDMOKSHA-2026-0065
Semantic IDVXD-2
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 inject forged SCSI INQUIRY data into VDI.xenstore_data, replacing the SM-generated SCSI device identity and serial number values in the XAPI database. The scsi/0x12/0x83 (device ID) and scsi/0x12/0x80 (serial number) keys are normally generated by SM drivers via scsiutil.py:335-353 during VDI attach. By writing forged values to the database field, an attacker poisons the disk identity metadata visible to downstream consumers. Forged SCSI data propagates through snapshot and clone operations (xapi_vdi.ml:861-862), potentially causing disk misidentification in backup, disaster recovery, and inventory systems.

Vulnerability Description

SM drivers generate synthetic SCSI INQUIRY pages during VDI attach. These values serve as disk identity metadata:

These values are generated by scsiutil.update_XS_SCSIdata() at scsiutil.py:335-353 and flow to guest xenstore sm-data/ through the SM runtime path. The XAPI database field VDI.xenstore_data stores a separate copy that is not consulted during the active attach path.

However, the database copy is consumed by:

  1. Snapshot/clone operations that copy xenstore_data to new VDI records
  2. API consumers that read VDI records (backup tools, inventory scanners)
  3. Pool join operations that copy VDI records across pool boundaries

A vm-admin can forge these values:

VDI.add_to_xenstore_data(vdi, "scsi/0x12/0x83", "<forged-device-id>")
VDI.add_to_xenstore_data(vdi, "scsi/0x12/0x80", "<forged-serial>")

Root Causes

  1. No key validation. The field accepts any key, including SCSI identity keys that are SM-internal metadata. There is no whitelist restricting which keys a user can set.

  2. No provenance tracking. There is no distinction between SCSI data written by SM drivers and SCSI data written by API users. Both are stored in the same field with identical structure.

  3. Missing RBAC protection. Zero map_keys_roles entries. A vm-admin has full write access to storage identity metadata.

  4. Propagation without verification. Snapshot, clone, and pool join operations copy xenstore_data without re-validating the SCSI identity values against the SM driver output.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
SCSI identity forgery Forged device ID and serial number in XAPI database vm-admin, API client Source-traced
Backup system confusion Backup tool misidentifies disk, leading to incorrect backup associations vm-admin, backup system reading VDI xenstore_data Modeled
Inventory poisoning Asset tracking system records forged SCSI identities vm-admin, CMDB reading VDI records Modeled
Propagation via snapshot Forged SCSI data copies to all snapshot/clone descendants vm-admin, snapshot trigger Source-traced

Chaining Analysis

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Restrict write access. Change the field write role to _R_POOL_ADMIN or _R_LOCAL_ROOT_ONLY.

Add key validation. Reject writes to SM-internal keys (scsi/*, vdi-uuid, storage-type, vdi-type) from non-SM sessions.

Tag provenance. Distinguish SM-generated vs. user-written entries in the database so consumers can verify the source.

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