Actively exploited CVSS 8.8 Security news
LiteLLM guardrail sandbox escape CVE-2026-40217 is being exploited, says CISA
On 18 November 2026 CISA added CVE-2026-40217 to its Known Exploited Vulnerabilities (KEV) catalog. The flaw is in LiteLLM, the open-source gateway many companies use to route requests to OpenAI, Anthropic and other model providers. Anyone holding the proxy's admin key can run arbitrary code on the server through the test endpoint for custom guardrails. The bug has been public since April 2026 and a fix has been available since May. CISA has not said how it learned of the exploitation.
Key points
- Who is affected: LiteLLM proxy from 1.81.8 up to releases before 1.83.10, according to the vendor advisory; X41 confirmed the flaw on the main-latest image from February 2026.
- The flaw: /guardrails/test_custom_code runs Python in a home-made sandbox that only filters source text, so bytecode manipulation gets code out of it (CWE-94).
- Precondition: the attacker needs the proxy admin key. Other LiteLLM bugs can provide one, such as SQL injection CVE-2026-42208, which CISA has listed as exploited since May.
- What to do: patch, block the endpoint, rotate the master key and the model provider API keys. US federal agencies must act by 2 Dec 2026.
Vulnerabilities: CVE-2026-40217
What happened
On 18 November 2026 the US Cybersecurity and Infrastructure Security Agency (CISA) added CVE-2026-40217 in BerriAI's LiteLLM to its Known Exploited Vulnerabilities catalog. US federal agencies must deal with it by 2 December 2026. Neither CISA nor the vendor has said how or where it is being exploited.
The flaw itself is not new. Markus Vervier of X41 D-Sec found it in February 2026, and after waiting in vain for a fix X41 published it on 8 April. The NVD record appeared on 10 April with a CVSS 3.1 score of 8.8. BerriAI released its advisory and a fix on 7 May. What is new is CISA's confirmation that attackers are using it.
Technical details
Besides routing requests to models, LiteLLM supports guardrails: checks on model input and output. Admins can write custom guardrails in Python and try them out via POST /guardrails/test_custom_code. The code runs in a hand-written sandbox which, according to X41, only scans the source text with regular expressions to block dangerous built-ins and attributes. An attacker sidesteps that check by building the names at runtime and manipulating CPython bytecode, ending up with arbitrary code execution inside the LiteLLM process (NVD: CWE-94 and CWE-420).
The precondition is the proxy's admin (master) key. The code runs with the privileges of the LiteLLM process, which X41 says is root in the default Docker image, and can reach the configuration, including model provider API keys, and the database.
Who is affected
| Product | Vulnerable | Fixed |
|---|---|---|
LiteLLM proxy (pip litellm, image ghcr.io/berriai/litellm) |
1.81.8 up to before 1.83.10 (BerriAI advisory) | 1.83.10 per metadata, new sandbox in 1.83.11 – we recommend 1.83.11 or later |
The main risk is to instances whose admin interface or proxy API is reachable from the internet or a broad internal network. Red Hat lists fixed packages for Ansible Automation Platform 2.6 and OpenShift AI 3.3 (RHSA-2026:24866 and RHSA-2026:30056).
How to tell if you were compromised
Neither CISA nor the vendor has published indicators of compromise. Look for general signs instead:
POST /guardrails/test_custom_coderequests in reverse proxy or LiteLLM access logs. Normally only an admin debugging guardrails sends these, and rarely.- Child processes of LiteLLM such as a shell,
curl,wgetorpython -c, and new outbound connections from the container. - New or changed guardrails (
POST /guardrails,PUT /guardrails/…) and new keys or users with theproxy_adminrole that nobody created. - Unusual usage at your model providers. Stolen API keys are often resold as access to models (LLMjacking).
What to do
- Upgrade LiteLLM to at least 1.83.11, preferably the current stable release.
- Block
POST /guardrails/test_custom_codeat your reverse proxy or API gateway if you do not need it, as both BerriAI and X41 recommend. - Rotate the master key and the model provider API keys stored in LiteLLM if the admin interface was reachable from outside.
- Restrict access to the admin interface with a firewall or VPN, and run the container as an unprivileged user (
--user).
Timeline
For more on protecting keys and access in AI infrastructure, see our report on AI-driven attacks and LLMjacking according to Google.
Updates
- 19 Nov 2026: first version.
FAQ
What is LiteLLM?
LiteLLM, from BerriAI, is an open-source library and proxy server that puts dozens of language models behind a single OpenAI-style API. Companies deploy it as an internal AI gateway that holds model provider API keys, budgets and access rights. Whoever controls the gateway controls those keys.
The flaw needs the admin key. Why does it matter so much?
Because in practice it tends to be the last link in a chain. NVD lists other LiteLLM flaws that let an ordinary user escalate to admin (CVE-2026-47101, CVE-2026-47102) and an unauthenticated SQL injection, CVE-2026-42208. And according to X41, the code runs with the privileges of the LiteLLM process, which is root in the default Docker image.
Is the fixed version 1.83.10 or 1.83.11?
BerriAI's advisory metadata lists 1.83.10 as patched, but the advisory text says the new RestrictedPython sandbox shipped in 1.83.11. We recommend 1.83.11 or later, ideally the current stable release, which also fixes the other bugs mentioned above.
Sources
Spotted a mistake? Let us know and we will correct it openly.