MOKSHA-2026-0027: Gateway/DNS Routing Hijack via PIF.other_config defaultroute/peerdns

Advisory IDMOKSHA-2026-0027
Semantic IDPOC-2
Published2026-04-24
CVSS 3.17.2 High
CVSS 3.1 VectorAV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N
CVSS 4.07.0 High
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:H/VA:L/SC:N/SI:L/SA:N
XAPI ObjectPIF
XAPI Fieldother_config:defaultroute, other_config:peerdns
Entry Rolepool-operator
ResearcherJakob Wolffhechel, Moksha

Affected Products

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

Summary

A pool-operator can hijack host-level network routing and DNS resolution by setting defaultroute=true and peerdns=true on an attacker-chosen PIF via PIF.other_config. The defaultroute key causes all host outbound traffic to route through the selected PIF's gateway (helpers.ml:219-234). The peerdns key redirects DNS queries to the selected PIF's DNS server. This enables man-in-the-middle attacks on management and storage traffic, and DNS poisoning at the host level affecting all VMs and host services. PIF.other_config has the highest merge precedence in the other_config merge chain, overriding both Network.other_config and Pool.other_config values.

Vulnerability Description

PIF.other_config is a Map(String, String) field writable by pool-operator that directly controls physical network interface behavior. The field has zero per-key RBAC and has the highest merge precedence in the nm.ml:112-120 merge chain.

The code path:

  1. pool-operator calls PIF.add_to_other_config(pif, "defaultroute", "true")
  2. helpers.ml:219-234 selects the first PIF with defaultroute=true as the gateway interface
  3. helpers.ml:254-267 selects the first PIF with peerdns=true as the DNS interface
  4. On next PIF plug, the host routing table and DNS configuration are updated
  5. All host outbound traffic routes through the attacker-chosen gateway
  6. All DNS queries resolve through the attacker-chosen DNS server

Impact Chain

With defaultroute control, the attacker can:

Root Causes

  1. Missing RBAC protection. PIF.other_config has zero map_keys_roles entries. The defaultroute and peerdns keys are writable by pool-operator.

  2. Missing validation. No check verifies that the PIF selected as default gateway is the intended management interface.

  3. Highest merge precedence. PIF.other_config overrides Network.other_config and Pool.other_config in the merge chain, making PIF-level injection authoritative.

  4. Insufficient logging. No security alert is generated when the default route or DNS interface is changed.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Management traffic MITM Intercept XAPI API calls between pool members pool-operator, multiple PIFs Source-traced
DNS poisoning Redirect host DNS resolution to attacker-controlled server pool-operator, peerdns=true Source-traced
Storage traffic redirection Route storage I/O through attacker-controlled gateway pool-operator, routing affects storage network Modeled
Via BOC-1 chain vm-admin escalates to pool-operator, then hijacks routing BOC-1 available Modeled (chained)

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Restrict to pool-admin. Protect defaultroute and peerdns via map_keys_roles at _R_POOL_ADMIN.

Validation gate. Verify that only the designated management PIF can be set as the default route.

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