MOKSHA-2026-0083: Boot Order Manipulation via VM.HVM_boot_params order

Advisory IDMOKSHA-2026-0083
Semantic IDHBP-1
Published2026-04-24
CVSS 3.13.1 Low
CVSS 3.1 VectorAV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/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 ObjectVM
XAPI FieldHVM_boot_params:order
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 set an arbitrary boot order string in VM.HVM_boot_params:order. The value is passed verbatim to QEMU as the -boot order=<value> argument via device.ml:3957-3958. XAPI performs no validation on the boot order string beyond replacing empty values with the default "cd" at xapi_xenops.ml:469-475. QEMU silently ignores unrecognized characters, limiting the practical impact to forcing PXE network boot (order=n) when the attacker also controls DHCP/PXE infrastructure. The VM.HVM_boot_params field has zero map_keys_roles entries.

Vulnerability Description

VM.HVM_boot_params is a Map(String, String) field defined at datamodel_vm.ml:55-58 with zero map_keys_roles entries and _R_VM_ADMIN as the default write role.

The order key flows from XAPI to QEMU:

  1. vm-admin writes HVM_boot_params:order=n via VM.add_to_HVM_boot_params
  2. XAPI reads the value at xapi_xenops.ml:469-475 via assume_default_if_null_empty
  3. If the value is empty or missing, it defaults to "cd"; otherwise the raw value passes through
  4. The value is included in the hvm_info.boot_order record sent to xenopsd
  5. xenopsd constructs QEMU argument: "-boot"; "order=" ^ info.Dm_Common.boot at device.ml:3957-3958
  6. QEMU is invoked via execve (no shell injection possible)
  7. QEMU interprets recognized characters (a=floppy, b=floppy, c=hard disk, d=CD-ROM, n=network PXE)
  8. Unrecognized characters are silently ignored

The use of execve via Forkhelpers.safe_close_and_exec prevents shell metacharacter injection. The practical attack surface is limited to selecting boot devices from the set that QEMU recognizes.

Root Causes

  1. Missing RBAC protection. VM.HVM_boot_params has zero map_keys_roles entries in datamodel_vm.ml. The order key is writable by vm-admin.

  2. Missing write-time validation. The boot order string is not validated against the set of recognized QEMU boot device characters (a, b, c, d, n). Any string is accepted.

  3. set_HVM_boot_params RBAC bypass. The set_HVM_boot_params method replaces the entire map and bypasses map_keys_roles per-key checks.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Force PXE boot VM boots from network, loading potentially attacker-controlled image vm-admin, attacker-controlled PXE infrastructure Live-tested (key injection confirmed)
Boot device reorder VM boots from unexpected device (CD instead of disk) vm-admin Live-tested
Arbitrary string injection Unrecognized characters silently ignored by QEMU vm-admin Live-tested

Chaining Analysis

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Add boot order validation. Restrict the order value to characters from the set {a, b, c, d, n} and enforce a maximum length at write time or at XAPI-to-xenopsd translation time.

Add map_keys_roles protection. Restrict the order key to _R_POOL_ADMIN in datamodel_vm.ml.

Replace with typed fields. The order key has a small, well-defined value set. It should be an enumeration field, not a free-form string in a map.

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