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.
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:
vm-admin writes HVM_boot_params:order=n via VM.add_to_HVM_boot_paramsxapi_xenops.ml:469-475 via assume_default_if_null_empty"cd"; otherwise the raw value passes throughhvm_info.boot_order record sent to xenopsd"-boot"; "order=" ^ info.Dm_Common.boot at device.ml:3957-3958execve (no shell injection possible)a=floppy, b=floppy, c=hard disk, d=CD-ROM, n=network PXE)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.
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.
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.
set_HVM_boot_params RBAC bypass. The set_HVM_boot_params method replaces the entire map and bypasses map_keys_roles per-key checks.
| 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 |
VM.HVM_boot_params for unexpected order values containing n (PXE boot)disclosure/vendor-detection-guidance.mdVM.HVM_boot_params entries for unexpected order valuesAdd 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:
datamodel_vm.ml:55-58 (VM.HVM_boot_params field definition), xapi_xenops.ml:469-475 (boot order read + default), xapi_xenops.ml:213-219 (assume_default_if_null_empty), device.ml:3957-3958 (QEMU -boot argument)disclosure/advisories/hbp-security-advisory.md (HBP-1)research/investigations/vm-hvm-boot-params.mdDiscovered and reported by Jakob Wolffhechel, Moksha.