MOKSHA-2026-0040: CHAP Credential Exposure via PBD.device_config

Advisory IDMOKSHA-2026-0040
Semantic IDPDC-4
Published2026-04-24
CVSS 3.16.5 Medium
CVSS 3.1 VectorAV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
CVSS 4.06.9 Medium
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:H/SI:L/SA:N
XAPI ObjectPBD
XAPI Fielddevice_config:chapuser, device_config:chappassword_secret
Entry Rolepool-operator
ResearcherJakob Wolffhechel, Moksha

Affected Products

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

Summary

CHAP authentication credentials for iSCSI storage connections in XAPI-based hypervisors (XenServer, XCP-ng) are stored in PBD.device_config as chapuser (plaintext username) and chappassword_secret (an XAPI secret reference). Any pool-operator can read the PBD record to obtain the chapuser and the secret reference, then call secret.get_value() to resolve the cleartext password. This enables cross-user credential theft: one pool-operator creates an iSCSI SR with CHAP credentials, and a different pool-operator in the same pool recovers the cleartext password via the XAPI secret resolution path. The credentials are also stored in plaintext in the XAPI database (state.db) on disk, accessible via BOC-1 filesystem read.

Vulnerability Description

PBD.device_config is the storage connection string for SM drivers. For iSCSI SRs, it carries CHAP authentication parameters:

The credential exposure path:

  1. pool-operator-A creates an iSCSI SR with CHAP credentials
  2. XAPI stores chapuser in plaintext in the PBD record
  3. XAPI stores chappassword_secret as a secret reference (e.g., OpaqueRef:abc123)
  4. pool-operator-B reads the PBD record: PBD.get_device_config(pbd) returns chapuser and chappassword_secret
  5. pool-operator-B calls secret.get_value(OpaqueRef:abc123) to resolve the cleartext password
  6. pool-operator-B now has the CHAP credentials for the storage array

The secret resolution path has no ownership check. Any pool-operator can resolve any XAPI secret, regardless of who created it.

Root Causes

  1. Plaintext credential storage. CHAP usernames are stored in plaintext in device_config. The password uses a secret reference, but the reference is readable by any pool-operator.

  2. Missing secret ownership model. XAPI secrets have no ownership or access control beyond the minimum role for secret.get_value(). Any session with pool-operator can resolve any secret.

  3. Cross-user credential access. The RBAC model permits one pool-operator to read credentials created by another pool-operator. There is no per-user or per-SR isolation of credentials.

  4. On-disk plaintext storage. The XAPI database (state.db) stores credentials in plaintext. BOC-1 filesystem read (MOKSHA-2026-0001, S2) directly exposes them.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Cross-user credential theft pool-operator-B recovers CHAP credentials created by pool-operator-A Two pool-operators in same pool, iSCSI SR with CHAP Confirmed (live-tested, ALL PASS)
Storage array unauthorized access Stolen CHAP credentials used to access storage array directly pool-operator, iSCSI SR with CHAP, network access to storage Modeled
Credential reuse attack CHAP credentials reused across multiple systems enable lateral movement pool-operator, CHAP credential reuse in environment Modeled
BOC-1 filesystem read vm-admin reads state.db via BOC-1 S2, extracts plaintext CHAP credentials vm-admin, BOC-1, iSCSI SR with CHAP Source-traced

Chaining Analysis

PDC-4 chains with BOC-1 and PDC-1/PDC-6:

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Credential isolation. Implement per-user or per-SR secret ownership. A pool-operator should only be able to resolve secrets they created or secrets associated with SRs they manage.

Deprecate plaintext credentials. Reject chappassword (plaintext) in device_config. Require chappassword_secret for all CHAP configurations.

Encrypt state.db credentials. CHAP credentials in the XAPI database should be encrypted at rest, not stored as plaintext.

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