MOKSHA-2026-0019: Tapdisk Memory Pool Injection via VDI.other_config mem-pool

Advisory IDMOKSHA-2026-0019
Semantic IDDOC-1
Published2026-04-24
CVSS 3.17.5 High
CVSS 3.1 VectorAV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
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 ObjectVDI
XAPI Fieldother_config:mem-pool
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 can inject an arbitrary mem-pool value into VDI.other_config that flows unsanitized to tapdisk - a root-level storage I/O daemon - via xenstore. The SM driver reads other_config["mem-pool"] in blktap2.py:1548-1550 without any sanitization and writes it to xenstore as a tapdisk parameter at blktap2.py:1565,1579. Tapdisk runs as root and reads the unsanitized pool name from xenstore to configure its memory allocation behavior. This creates a direct injection path from a low-privilege API user into a root-level service's configuration.

Vulnerability Description

VDI.other_config is a Map(String, String) field writable by vm-admin. The mem-pool key controls which memory pool tapdisk uses for the VDI's I/O buffers. The value is read from the XAPI database by the SM driver and written to xenstore without sanitization.

Data Flow

vm-admin calls VDI.add_to_other_config(vdi, "mem-pool", "<arbitrary-value>")
  -> blktap2.py:1548-1550 reads other_config["mem-pool"]
  -> pool_name_override = vdi_config.get(POOL_NAME_KEY)  # "mem-pool"
  -> No sanitization, no format check, no allowlist
  -> blktap2.py:1565 writes to xenstore: <tapdisk-path>/mem-pool = <arbitrary-value>
  -> tapdisk (running as root) reads the xenstore key
  -> Uses the value to configure memory pool allocation
# blktap2.py:1546-1567
vdi_config = self._session.xenapi.VDI.get_other_config(vdi_ref)
pool_name_override = vdi_config.get(POOL_NAME_KEY)      # "mem-pool"
if pool_name_override:
    # No sanitization - value written directly to xenstore
    ...

Tapdisk as Root Service

Tapdisk is the userspace block device daemon that handles VDI I/O in XAPI-based hypervisors. It runs as root in dom0. The mem-pool xenstore key controls how tapdisk allocates memory for I/O buffers associated with a VDI. An attacker-controlled value in this key reaches a root service's configuration path.

mem-pool-size-rings

A related key, mem-pool-size-rings, has partial validation: blktap2.py:1551-1563 enforces a range of 1-8 for this value. However, mem-pool (the pool name itself) has zero validation.

Root Causes

  1. Missing RBAC protection. VDI.other_config has zero map_keys_roles entries for infrastructure keys. The mem-pool key is writable by vm-admin.

  2. Zero sanitization. The SM driver reads the value and writes it to xenstore without any sanitization, format check, or allowlist.

  3. Privilege boundary violation. A vm-admin user (lowest management role) can inject values that reach a root-level service's configuration via xenstore.

  4. Inconsistent validation. mem-pool-size-rings has range validation (1-8), but mem-pool has none - inconsistent handling of related configuration keys.

Affected Systems

Directly Affected

Storage Subsystems Affected

Exploitation Scenarios

Scenario Impact Pre-conditions Status
Memory pool name injection Arbitrary value reaches tapdisk config via xenstore VDI with tapdisk backend Confirmed (injection path code-traced end-to-end)
Tapdisk memory behavior manipulation Altered memory allocation for VDI I/O Tapdisk reads the injected pool name Modeled (depends on tapdisk's pool name handling)
Cross-VDI memory pool collision Force VDIs to share memory pools, causing resource contention Multiple VDIs on same host Modeled

Detection

Remediation

Short-Term Mitigations

Long-Term Fix

Input sanitization. In blktap2.py, whitelist alphanumeric characters for mem-pool and enforce a maximum length before writing to xenstore.

Add map_keys_roles. Protect mem-pool in datamodel.ml at _R_POOL_ADMIN to prevent vm-admin from setting it.

Xenstore write validation. Implement a validation layer between SM driver reads and xenstore writes for all tapdisk parameters.

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