CISA Confirms Attacks on LiteLLM Guardrail Sandbox Escape (CVE-2026-40217)
Key Takeaways
- CISA added CVE-2026-40217, a LiteLLM code execution flaw, to its Known Exploited Vulnerabilities catalog on November 18, 2026.
- The flaw lets an authenticated user escape the sandbox behind the /guardrails/test_custom_code endpoint through Python bytecode rewriting.
- It affects LiteLLM releases through April 8, 2026, carries a CVSS score of 8.8 and has public proof-of-concept code.
- Researchers have shown it can be chained with two privilege escalation flaws so a low-privilege account reaches code execution.
- Federal agencies must remediate by December 2, 2026.
A Guardrail Testing Feature Becomes a Path Into the AI Gateway
LiteLLM is a widely used open-source proxy that routes applications to many model providers and stores their API keys. CISA confirmed on November 18 that attackers are exploiting CVE-2026-40217, a sandbox escape in its custom-code guardrail feature, SecurityOnline reported. Because the gateway concentrates credentials and traffic, code execution there exposes far more than a single application.
What We Know
X41 D-Sec disclosed the flaw in April 2026. The NVD entry, published April 10, says LiteLLM through April 8, 2026 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI. The endpoint lets authenticated users submit Python that LiteLLM runs to test custom guardrails, the filters that inspect or transform model requests and responses. The CVSS v3 score is 8.8.
In June, a Cloud Security Alliance research note described a three-CVE chain of CVE-2026-47101, CVE-2026-47102 and CVE-2026-40217 that lets a low-privilege account holder escalate to administrator and run arbitrary Python, rated CVSS 9.9. That note focused on CVE-2026-42271, a separate LiteLLM command injection that CISA had listed as exploited on June 8.
On November 18, CISA added CVE-2026-40217 to the catalog alongside flaws in Synology DSM, Apache Axis and REDCap, with a December 2 deadline for federal agencies. CISA did not publish details of the attacks and lists ransomware use as unknown. Red Hat lists several AI products that bundle LiteLLM, including OpenShift AI 3.3, and has published errata.
What Happened
The custom-code guardrail feature runs administrator-supplied Python inside a hand-built sandbox meant to block dangerous operations. X41's proof of concept walks Python's object hierarchy and rewrites generator bytecode so that submitted code reaches objects the sandbox was supposed to hide, then runs operating system commands with the privileges of the LiteLLM process. Public proof-of-concept code and a Nuclei detection template are available.
The endpoint requires authentication, but that bar is lower than it looks. Some deployments keep a default or weak master key, and the privilege escalation chain lets lower-privilege users gain admin rights first. Once code runs on the proxy, an attacker can read the environment and configuration that hold provider API keys, the master key and database credentials, and can observe or alter traffic between applications and models.
The AI-specific twist is that the vulnerable feature is a safety control. A guardrail that executes arbitrary code inside the gateway turns the policy layer into an execution surface, and the gateway's role as a shared hub for every model call magnifies the impact of a single host compromise.
Why It Matters
LiteLLM sits between many enterprises and their model providers, so it holds the keys and sees the prompts. Code execution on that host can expose every connected provider account, run up spend on stolen keys, leak sensitive prompts and responses, and give attackers a foothold in the network segment that serves AI applications.
CISA's listing confirms attackers are using the flaw, not just studying it. It joins earlier LiteLLM entries in the catalog, CVE-2026-42208 in May and CVE-2026-42271 in June, and arrives as other reports describe automated campaigns hunting exposed AI gateways for keys. Many teams deploy gateways quickly for experiments and leave them running long after the pilot ends.
Federal agencies face a hard deadline, and regulated enterprises should treat the gateway as production infrastructure covered by vulnerability management, logging and access reviews. Frameworks such as the NIST AI RMF expect organizations to know where AI infrastructure runs and to manage its known risks.
PointGuard AI Perspective
CVE-2026-40217 is a reminder that AI gateways are high-value infrastructure that needs the same discipline as identity systems. PointGuard AI helps organizations find and harden them.
AI Discovery & Inventory identifies LiteLLM and other gateways, proxies and AI application builders across cloud accounts and code repositories, including instances stood up for pilots and forgotten. AI Security Posture Management then checks those deployments for exposed management endpoints, default or shared master keys, overly permissive access and unpatched versions, and prioritizes findings by the credentials and data each gateway can reach.
PointGuard's Runtime Guardrails use fine-tuned detection models to inspect prompts, responses and tool outputs for prompt injection, jailbreaks and sensitive data, giving teams consistent policy enforcement without writing custom code filters on the gateway itself.
Credential hygiene limits the damage if a gateway is breached. Short-lived, scoped credentials and runtime secret brokering reduce how many long-lived provider keys sit on any one host. Teams can also follow related LiteLLM disclosures through the PointGuard AI Security Incident Tracker and map them to their own gateway inventory.
As AI traffic consolidates through gateways, trustworthy adoption depends on treating them as critical systems: inventoried, patched, monitored and designed so one flaw cannot unlock every model account.
Incident Scorecard Details
Total AISSI Score: 7.00/10
Criticality: 8, AI gateway holding provider keys, master key and model traffic. AISSI weighting: 25%
Propagation: 7, Shared hub for many applications and accounts; reachable from low privilege through a chain. AISSI weighting: 20%
Exploitability: 7, CISA-confirmed exploitation with public proof-of-concept code. AISSI weighting: 15%
Supply Chain: 7, Open-source gateway embedded in enterprise stacks and vendor AI products. AISSI weighting: 15%
Business Impact: 6, KEV listing and federal deadline; no named victims or quantified losses. AISSI weighting: 25%
Sources
Third-Party Sources
- SecurityOnline: CISA Adds 4 Exploited Flaws to KEV, Including LiteLLM
- NIST NVD: CVE-2026-40217
- Cloud Security Alliance: LiteLLM AI Gateway, KEV-Listed Attack Chain Enables Full Takeover
