MOKSHA-2026-0010: Block Device Path Injection via PBD.device_config

Advisory IDMOKSHA-2026-0010
Semantic IDPDC-5
Published2026-04-24
CVSS 3.18.4 High
CVSS 3.1 VectorAV:N/AC:L/PR:H/UI:N/S:C/C:N/I:H/A:H
CVSS 4.08.1 High
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:H/VA:H/SC:L/SI:L/SA:H
XAPI ObjectPBD
XAPI Fielddevice_config:device
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 inject an arbitrary block device path via PBD.device_config:device when creating an EXT or LVM SR. The SM driver reads the path unchecked and passes it to pvcreate and vgcreate, which execute destructive operations on the attacker-chosen device. LVHDSR has a systemroot check that blocks the immediate host root device, but this check does not protect other partitions, additional disks, remote block devices, or other VMs' local storage. The result is data destruction on arbitrary block devices accessible to the host.

Vulnerability Description

When creating an EXT or LVM SR, the SM driver reads device_config:device to determine which block device to initialize as a storage repository. The value flows from the XAPI database to LVM subprocess calls without adequate validation.

Data Flow

SR.create(device_config={device: "/dev/sdb"})
  -> PBD stored with unchecked device path
  -> PBD.plug() triggers LVHDSR.create()
  -> LVHDSR.create() reads self.dconf['device'] (line 457)
  -> lvutil.createVG() called with attacker device path (line 508)
  -> pvcreate /dev/sdb
  -> vgcreate <sr-uuid> /dev/sdb
  -> Block device is now an LVM physical volume (original data destroyed)

Systemroot Check Limitations

LVHDSR implements a systemroot check at lines 467-470 that compares the requested device against the host's root device. This prevents targeting /dev/sda (or whatever device hosts the root filesystem). However, the check has several gaps:

  1. Other partitions on the root disk - /dev/sda2, /dev/sda3 are not protected
  2. Additional disks - /dev/sdb, /dev/sdc, etc. are not protected
  3. Remote block devices - iSCSI LUNs, multipath devices are not protected
  4. Device mapper paths - /dev/mapper/* paths bypass the check
  5. Symlinks - alternate paths to the same device bypass the string comparison

Destructive Operation

pvcreate overwrites the first sectors of the target device with LVM metadata. This is a destructive operation that renders the previous contents of the device unrecoverable without backup. vgcreate then creates a volume group on the device, completing the initialization. Both operations execute as root.

Root Causes

  1. Inadequate device validation. The systemroot check protects only the immediate root device. It does not implement a comprehensive device allowlist.

  2. No device ownership verification. The SM driver does not verify that the requested device is unpartitioned, unused, or intended for SR creation.

  3. Destructive operation on unvalidated input. pvcreate is a destructive operation that should only execute on devices explicitly approved for storage initialization.

Affected Systems

Directly Affected

Storage Backends Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Non-root partition destruction Destroy data on host partitions other than root Target host has additional partitions ALL PASS (live-tested)
Secondary disk destruction Destroy data on secondary disk (e.g., local backup disk) Target host has additional disks ALL PASS (live-tested)
Remote LUN targeting Destroy data on an iSCSI LUN presented to the host iSCSI LUN accessible Modeled (follows from same code path)
BOC-1 chain vm-admin escalates to pool-operator via BOC-1 S3, then targets any device BOC-1 available Modeled (two-step chain)

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Block device allowlist. Expand the systemroot check in LVHDSR to reject all devices not on an explicit allowlist. Default policy: only unused, unpartitioned block devices that are not mounted and not part of any existing volume group.

Device ownership verification. Before executing pvcreate, verify that the target device is truly available for SR creation: not mounted, not in an existing VG, not a partition on a system disk.

Confirmation step. Require an explicit confirmation for destructive device initialization, independent of the API call that creates the SR.

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