MOKSHA-2026-0051: Config Drive Misidentification via VDI.other_config config-drive

Advisory IDMOKSHA-2026-0051
Semantic IDDOC-7
Published2026-04-24
CVSS 3.15.4 Medium
CVSS 3.1 VectorAV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
CVSS 4.02.3 Low
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 Fieldother_config:config-drive
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 mark any VDI as a cloud-init config drive by setting config-drive=true in VDI.other_config. The config-drive key is defined in xapi_globs.ml:289 as a sync key and consumed by import.ml:1180 during migration and restore operations. When a non-config VDI is falsely flagged, guest cloud-init agents misinterpret its contents as trusted hypervisor-provided metadata, potentially initializing the guest with attacker-controlled configuration. The VDI.other_config field has no per-key RBAC protection for the config-drive key.

Vulnerability Description

VDI.other_config is a Map(String, String) field writable by vm-admin. The config-drive key controls whether a VDI is treated as a cloud-init metadata source during migration and import operations.

The code path:

  1. vm-admin sets config-drive=true on a non-config VDI: VDI.add_to_other_config(vdi, "config-drive", "true")
  2. The key is defined in xapi_globs.ml:289 as part of vdi_other_config_sync_keys
  3. During migration or import, import.ml:1180 synchronizes the config-drive flag to the destination
  4. Guest cloud-init reads the flagged VDI as a metadata source
  5. The guest initializes with whatever data is on the VDI, treating it as trusted configuration

No validation occurs on the config-drive value. The flag is a simple presence check - any non-empty value is treated as true.

Root Causes

  1. Missing RBAC protection. VDI.other_config has map_keys_roles entries only for folder and XenCenter.CustomFields.*. The config-drive key is writable by vm-admin without restriction.

  2. No VDI content validation. The config-drive flag is a simple metadata tag. No check verifies that the VDI actually contains valid cloud-init metadata in the expected format (ISO 9660, VFAT, or similar).

  3. Trusted metadata channel abuse. Guest cloud-init agents treat hypervisor-provided config drives as fully trusted. The hypervisor provides no mechanism for the guest to verify the provenance of the config drive flag.

  4. set_other_config RBAC bypass. The set_other_config method replaces the entire map atomically and bypasses map_keys_roles per-key checks entirely.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Config drive injection Mark a data VDI as config-drive; guest cloud-init reads attacker data as configuration vm-admin, cloud-init guest Live-tested (flag accepted)
Migration propagation False config-drive flag propagates to destination pool during migration vm-admin, cross-pool migration Source-traced
Guest misconfiguration Guest initializes with wrong network config, repos, or SSH keys from fake config drive vm-admin, cloud-init guest Modeled
BOC-1 chain vm-admin uses BOC-1 S3 to bulk-modify config-drive flags across all VDIs vm-admin, BOC-1 Source-traced

Chaining Analysis

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Add map_keys_roles protection. Restrict config-drive to _R_POOL_ADMIN in the VDI field definition in datamodel.ml.

Validate config drive content. When config-drive=true is set, verify that the VDI contains valid cloud-init metadata format before accepting the flag.

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