CVE-2026-107204
Unauthenticated RCE via /run_script endpoint allowing OS command execution.
- CVSS 9.3
- CWE-306
- Input Validation and Sanitization
- Remote
LMCache through 0.5.5 contains an unauthenticated remote code execution vulnerability that allows remote attackers to execute Python code by posting scripts to the /run_script endpoint. Attackers can recover real builtins through the injected FastAPI app object, bypassing the guarded __import__, to import os and run operating system commands as the LMCache process.
- CWE
- CWE-306
- CVSS base score
- 9.3
- Published
- 2026-10-07
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- LMCache
- Fixed by upgrading
- Yes
Solution
Upgrade LMCache to version 0.5.6 (or later), which patches the unauthenticated /run_script remote code execution vulnerability.
Vulnerable code sample
from fastapi import FastAPI, Request
app = FastAPI()
@app.post("/run_script")
async def run_script(request: Request):
# VULNERABLE: exec of attacker-controlled script allowing import of builtins
script = (await request.body()).decode()
exec(script, {"__builtins__": {}})
return {"status": "executed"}Patched code sample
from fastapi import FastAPI, Request, HTTPException
app = FastAPI()
@app.post("/run_script")
async def run_script(request: Request):
# FIX: reject arbitrary code; only allow predefined safe commands
raise HTTPException(status_code=403, detail="Execution of arbitrary scripts is disabled")Cite this entry
@misc{vaitp:cve2026107204,
title = {{Unauthenticated RCE via /run_script endpoint allowing OS command execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-107204},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-107204/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
