MOKSHA-2026-0054: MAC Address Collision via VM.other_config mac_seed

Advisory IDMOKSHA-2026-0054
Semantic IDVOC-4
Published2026-04-24
CVSS 3.15.3 Medium
CVSS 3.1 VectorAV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/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 Fieldother_config:mac_seed
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 cause MAC address collisions by setting the mac_seed key in VM.other_config to a value copied from another VM. The MAC generation algorithm in xapi_vif_helpers.ml:212-232 uses this seed deterministically - two VMs with the same mac_seed generate identical MAC addresses for the same device IDs. Pool-level duplicate detection exists at xapi_pool.ml:3425-3456 but only runs during pool join and import operations, not during direct add_to_other_config calls. The resulting MAC collisions cause network connectivity failures, ARP table corruption, and traffic misdirection.

Vulnerability Description

VM.other_config is a Map(String, String) field writable by vm-admin. The mac_seed key controls deterministic MAC address generation for VIFs. The key has partial RBAC protection via map_keys_roles for three keys (pci, folder, XenCenter.CustomFields.*), but mac_seed is not among them.

The MAC generation algorithm:

  1. xapi_vif_helpers.ml:212-232 reads mac_seed from VM.other_config
  2. The seed is hashed iteratively: chain (dev * 2) hash seed where dev is the VIF device index
  3. The hash output is formatted as a MAC address in the fe:ff:ff:xx:xx:xx range
  4. Two VMs with the same mac_seed produce identical MACs for the same device indices

Attack path:

  1. vm-admin reads the mac_seed from VM-A: VM.get_other_config(vm_a)["mac_seed"]
  2. Sets the same seed on VM-B: VM.add_to_other_config(vm_b, "mac_seed", "<vm_a_seed>")
  3. Creates a VIF on VM-B with the same device index as VM-A's VIF
  4. XAPI generates an identical MAC address for VM-B's VIF
  5. Both VIFs on the same bridge cause MAC collision

Mitigating factors:

Root Causes

  1. Missing RBAC protection. VM.other_config has map_keys_roles entries for pci, folder, and XenCenter.CustomFields.* only. The mac_seed key is writable by vm-admin without restriction.

  2. Incomplete duplicate detection. Pool-level MAC seed validation runs during pool join and import but not during direct other_config key writes. The API path bypasses the safety check.

  3. No write-time validation. No format validation is performed when mac_seed is set. Any string is accepted, including seeds copied from other VMs.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Targeted MAC collision Clone VM-A's mac_seed to VM-B, causing identical MACs and traffic misdirection vm-admin, two VMs on same bridge Source-traced
ARP table poisoning MAC collision corrupts bridge ARP tables, redirecting traffic vm-admin Modeled
DHCP lease conflict Duplicate MACs receive conflicting DHCP leases vm-admin, DHCP network Modeled
BOC-1 chain vm-admin uses BOC-1 S3 to bulk-set mac_seed across all VMs vm-admin, BOC-1 Source-traced

Chaining Analysis

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Extend duplicate detection to API writes. Run pool-level mac_seed validation on every add_to_other_config and set_other_config call, not just during pool join/import.

Add map_keys_roles protection. Restrict mac_seed to _R_POOL_ADMIN in the VM field definition in datamodel.ml.

Validate format on write. Enforce UUID format for mac_seed values to prevent arbitrary strings.

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