MOKSHA-2026-0033: Rate Limit Bypass via VIF.qos_algorithm_params Large kbps Overflow

Advisory IDMOKSHA-2026-0033
Semantic IDVQP-1
Published2026-04-24
CVSS 3.17.1 High
CVSS 3.1 VectorAV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:L
CVSS 4.05.3 Medium
CVSS 4.0 VectorAV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:L
XAPI ObjectVIF
XAPI Fieldqos_algorithm_params
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 VIF.qos_algorithm_params:kbps to an extremely large value (e.g., 999999999) that causes bytes_per_interval to exceed 0xffffffffL during computation in xenopsd. xenopsd correctly rejects the out-of-range value and does not write a rate key to xenstore - but does so silently with only a debug-level log. XAPI continues to show the configured rate limit in the database. The result is an observability gap: administrators and automation tools believe rate limiting is active on the VIF when it is not. The VM operates without network rate limiting while the management plane reports it as enforced.

Vulnerability Description

VIF.qos_algorithm_params is a Map(String, String) field writable by vm-admin. When VIF.qos_algorithm_type is set to ratelimit, XAPI parses the kbps key via Int64.of_string at xapi_xenops.ml:795 with no range validation and forwards the rate tuple to xenopsd.

The code path:

  1. vm-admin sets VIF.qos_algorithm_params:kbps to 999999999
  2. XAPI parses kbps via Int64.of_string - accepts any 64-bit signed integer (xapi_xenops.ml:795)
  3. XAPI computes (kbps, timeslice_us) rate tuple with no range check
  4. xenopsd receives the tuple and computes bytes_per_interval = kbps * 1000 / 8 * timeslice_us / 1000000
  5. device.ml:850 checks whether bytes_per_interval > 0xffffffffL - the check fails for large kbps values
  6. xenopsd emits a debug-level log and does not write the rate key to xenstore
  7. The VIF operates without rate limiting; XAPI DB still shows kbps=999999999

The observability gap arises because xenopsd's rejection is invisible to XAPI and to administrators. XAPI does not receive an error callback; the VIF plugs successfully without rate limiting.

Root Causes

  1. Missing write-time validation. XAPI accepts any value for kbps without range validation. Negative, zero, and overflow-inducing values are stored in the database.

  2. Silent consumer-side rejection. xenopsd correctly rejects invalid rates but only emits a debug-level log. XAPI is not notified of the rejection.

  3. State inconsistency. The XAPI database reports rate limiting as configured while the data plane has no rate enforcement. Administrators and automation cannot detect the discrepancy without directly inspecting xenstore.

  4. Missing RBAC protection. VIF.qos_algorithm_params has zero map_keys_roles entries. All keys inherit the vm-admin class default.

Affected Systems

Directly Affected

Indirectly Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Rate limit bypass via large kbps VIF operates without rate limiting while XAPI shows rate configured vm-admin, VIF with qos_algorithm_type=ratelimit Confirmed (live-tested)
Bandwidth starvation Unthrottled VM consumes shared network capacity, starving co-hosted VMs vm-admin, shared network with rate-limited VIFs Modeled
Compliance violation Network QoS policies appear enforced when they are not vm-admin, compliance-sensitive deployment Modeled

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Add write-time validation. Validate kbps at XAPI write time: reject negative values, zero, and values exceeding reasonable network capacity (e.g., 100 Gbps). Return an error to the caller.

Propagate rejection to XAPI. When xenopsd rejects a rate value, report the failure back to XAPI so the database reflects actual enforcement state.

Range-validate timeslice_us. Enforce reasonable bounds on the scheduling timeslice parameter.

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