Status: CVE-2026-40217 is in CISA's Known Exploited Vulnerabilities (KEV) catalog, added November 18, 2026, with a federal due date of 2 December 2026. It is an escape from the sandbox LiteLLM uses to test custom guardrail code, and it lets the caller run code in the LiteLLM proxy process, which LiteLLM says runs as root in the default Docker image. The main limit: LiteLLM says reaching the vulnerable endpoint "requires a proxy-admin credential in default configurations". The fix is old: LiteLLM's advisory lists 1.83.10 as the first patched version, and its text says to upgrade to 1.83.11 or later; both shipped in April 2026, but later LiteLLM fixes mean you should upgrade to a current release. This is a different flaw from the LiteLLM SQL injection, command injection and supply-chain incidents we covered earlier this year. We last checked at 13:34 EST on 19 November 2026.
Executive Summary
LiteLLM is an open-source AI gateway: a proxy that sits between applications and model providers such as OpenAI and Anthropic, and holds the provider API keys, virtual keys and spend controls for every team that uses it. Guardrails are one of its features: administrators can write custom Python code that inspects or blocks prompts and responses, and test it through the POST /guardrails/test_custom_code endpoint.
LiteLLM's advisory (GHSA-wxxx-gvqv-xp7p) describes the flaw: the endpoint "runs user-supplied Python inside a hand-rolled sandbox. The sandbox can be escaped using bytecode-level techniques, allowing arbitrary code execution in the proxy process". CISA's KEV entry says the same: remote attackers can "execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI."
Three things decide whether a LiteLLM deployment is exposed:
- An affected version. LiteLLM's advisory lists versions from 1.81.8 up to, but not including, 1.83.10. The CVE record, filed by MITRE before the fix, says "LiteLLM through 2026-04-08".
- A proxy-admin credential. This is the main limiting factor, but possibly a weaker one than it looks: Google's threat intelligence team reports attackers turning ordinary virtual keys into proxy-admin credentials and attributes this to CVE-2026-40217, while Corgea's code analysis says the technique is a separate bug fixed in 1.84.0. Either way, upgrade to 1.84.0 or later. In default configurations the attacker needs the master key or another key with the proxy admin role, or any user account on a version that still has CVE-2026-47102: that flaw lets a logged-in user set their own role to proxy admin through the
/user/updateendpoint, and LiteLLM fixed it in 1.83.10, the same release that fixed this CVE. Our June advisory on the LiteLLM privilege-escalation chain covered it, together with CVE-2026-47101 (internal users creating keys that reach admin-only routes, fixed in 1.83.14), as a route from a low-privilege account to this sandbox escape. That protection depends on a master key being set: LiteLLM's related advisory on custom code guardrails says "In deployments without a configured master key, callers could be treated as proxy administrators" (GHSA-72m8-9m7m-h278). ConfirmLITELLM_MASTER_KEYis set on every proxy and that it is not a default or guessable value. In the attacks Zenity Labs recorded, every request guessed a master key. - Network reach to the proxy's admin API. The attacker must be able to send requests to the proxy.
How serious is it in practice? (Rescana guidance) On its own this is an admin-only flaw, and LiteLLM rates it Moderate. What makes it matter is how admin credentials leak. A proxy-admin key can sit in CI variables, notebooks and deployment manifests, and earlier LiteLLM flaws gave attackers ways to steal keys, or, on unpatched versions, to promote an ordinary user to admin (CVE-2026-47102): our advisory on CVE-2026-42208 covered a pre-authentication SQL injection whose attackers targeted the table holding virtual and master keys. With an admin key in hand, this flaw turns "can change proxy settings" into "can run code as root inside the container that holds every provider key". CISA's KEV listing means exploitation has been seen, so treat any unpatched, reachable proxy as urgent and assume its keys may be exposed.
Exploitation status. CISA added CVE-2026-40217 to KEV on 18 November 2026 and lists ransomware use as "Unknown". CISA's SSVC entry on the CVE record rates exploitation "active", automatable "no" and technical impact "total". Neither LiteLLM nor CISA has published details of the attacks or indicators of compromise. Google's Threat Intelligence Group (GTIG), whose reporting The Hacker News ties to the KEV listing, described an LLMjacking intrusion in which attackers who had bought ordinary LiteLLM virtual keys raised them to full proxy-admin credentials on the victim's gateway. GTIG attributes that step to CVE-2026-40217 in its November 2 report and again in its November 16 AI Threat Tracker. The November 2 report describes the technique as a user ID rebind in the /key/regenerate endpoint. Corgea's code analysis (cited unlinked, because its page reproduces exploit code) says that rebind is a separate bug with no CVE of its own, fixed in 1.84.0, and that upgrading to 1.83.10 closes the CVE but not the rebind. LiteLLM's pull request #27793, merged 13 May 2026, is titled "close /key/regenerate ownership-rebind + premium-gate bypass", and 1.84.0 includes it. We cannot tell from GTIG's reports which flaw its victim hit. GTIG does not say which version the victim ran or whether the sandbox escape was then used. Zenity Labs reported in June that its honeypots recorded 569 requests to the vulnerable endpoint between 15 April and 24 May 2026. Each one guessed a proxy master key, and some carried sandbox-escape payloads that Zenity confirmed worked against an unpatched proxy. Public proof-of-concept code has been on GitHub since May 2026, per repository descriptions in GitHub search; we have not opened it and do not link it.
Because Zenity Labs recorded attempts from 15 April 2026, search logs back to when you first ran 1.81.8 or later, not just recent weeks; where logs do not reach that far, treat exposure as unknown and rotate keys (Rescana guidance).
Technical Information
The flaw. The custom code guardrail lets an administrator submit a Python function to test against sample input. Before the fix, LiteLLM ran that code in what its advisory calls a "hand-rolled sandbox", and bytecode-level techniques could escape it. The fix replaced the hand-rolled sandbox with RestrictedPython, according to the advisory. CISA classifies the flaw as CWE-420, unprotected alternate channel; LiteLLM's advisory lists CWE-913, improper control of dynamically-managed code resources; Red Hat classifies it as CWE-94, code injection.
Impact. Code runs in the LiteLLM proxy process. LiteLLM says the process "runs as root in the default Docker image". From there an attacker can read the proxy's environment and configuration, which typically hold provider API keys and database credentials (Rescana guidance).
Severity: the scores disagree. LiteLLM's advisory rates it Moderate, 5.9 under CVSS 4.0, with high privileges and high attack complexity. The CVE record and NVD carry 8.8 High under CVSS 3.1, from MITRE (the CNA) and Red Hat, with low privileges required; Red Hat rates it Important. The gap comes down to how each scorer treats the admin credential requirement. Neither changes the action: it is in KEV, so patch. GitHub's reviewed Advisory Database entry shows High, 7.5 under CVSS 4.0, which is what many scanners display.
Downstream products. Red Hat ships LiteLLM inside some products. Its security data lists fixes for the Ansible Automation Platform 2.6 lightspeed-chatbot image (RHSA-2026:24866, 9 June 2026) and the OpenShift AI 3.3 llama-stack-core image (RHSA-2026:30056, 25 June 2026).
Timeline (EST).
- 10 April 2026, 08:43 EST: CVE-2026-40217 published by MITRE, covering LiteLLM "through 2026-04-08".
- 15 April to 24 May 2026: Zenity Labs' honeypots record 569 requests to the vulnerable endpoint.
- 18 April 2026, 21:36 EST: LiteLLM 1.83.10 published to PyPI.
- 21 April 2026, 21:02 EST: LiteLLM 1.83.11 published to PyPI.
- 27 April 2026, 12:01 EST: v1.83.10-stable release, which the advisory names as the patched release.
- 6 May 2026, 19:50 EST: LiteLLM publishes GHSA-wxxx-gvqv-xp7p.
- 2 November 2026: Google's Threat Intelligence Group reports attackers on a LiteLLM gateway turning virtual keys into proxy-admin credentials and attributes this to CVE-2026-40217.
- 18 November 2026: CISA adds the CVE to KEV (catalog version 2026.11.18, released 14:17 EST), due 2 December.
Affected Product Versions
| Package | Affected | Fixed |
|---|---|---|
| litellm (PyPI) and LiteLLM proxy Docker images | 1.81.8 up to, not including, 1.83.10 | 1.83.10 per the advisory's patched-versions field; upgrade to 1.83.11 or later per the advisory text |
1.83.10 or 1.83.11? LiteLLM's advisory is inconsistent. Its patched-versions field says ">= 1.83.10" and links the v1.83.10-stable release, while its description says "Fixed in 1.83.11" and "Upgrade to 1.83.11 or later." Upgrading to 1.83.11 or later satisfies both for this flaw; see Patch below for the release to target (Rescana guidance). In practice, any current release is far past both: PyPI listed 1.110.1 as the latest version when we checked.
Do not land on 1.107.0. LiteLLM's release pipeline published a malicious 1.107.0 to PyPI and Docker on 21 October 2026, since pulled. If you upgrade from an old version, pin a specific known-good release and check our LiteLLM 1.107.0 advisory for the exposure windows.
How to Find Your Exposure
The steps below are Rescana guidance unless a source is named.
1. Find every LiteLLM proxy. Include platform-team gateways, data science deployments, internal tools that bundle LiteLLM, and the Red Hat products listed above. Developers may run the proxy in a container outside central IT's inventory.
2. Read the version. For Python installs, pip show litellm. For containers, check the image tag and digest in your deployment manifests; floating tags such as main-latest tell you nothing, so resolve the digest.
3. Check who holds proxy-admin credentials. List where the master key and any keys with the proxy admin role are stored: CI variables, secrets managers, notebooks, .env files and deployment manifests. Every copy is a way to meet the precondition.
4. Check reachability. Note which proxies accept connections from the internet or from broad internal networks, and whether the admin API is exposed on the same listener as the model API.
5. Confirm after upgrading. Re-check the version and confirm the running container uses the new image digest.
Workaround and Mitigation
Patch. Upgrade to a current LiteLLM release, pinned to a specific version, not just 1.83.11, which closes this flaw only. LiteLLM's later advisories fix other flaws that hand an attacker the proxy-admin access this one needs, or bypass authentication outright. Google's reporting ties a /key/regenerate virtual-key rebind to this CVE; Corgea's analysis says it is a separate bug fixed in 1.84.0. Upgrade to 1.84.0 or later either way. CVE-2026-59822, which is in CISA's Known Exploited Vulnerabilities (KEV) catalog, added September 2, 2026, is fixed in 1.84.0 (GHSA-7488-6r32-c95q). CVE-2026-49468 (GHSA-4xpc-pv4p-pm3w) is also fixed in 1.84.0. GHSA-2rwg-2wh4-7c4f, an authenticated secret exfiltration published on 12 November 2026, is fixed in 1.106.9, 1.108.6 and 1.109.1. A master-key leak on Enterprise-licensed proxies is fixed in 1.103.10, 1.104.8, 1.105.6 and 1.106.5 (GHSA-w4c7-34wj-hqm8). PyPI listed 1.110.1 as the latest release when we checked (Rescana guidance). CISA's KEV required action is to apply mitigations per vendor instructions and follow BOD 26-04, or discontinue use of the product if mitigations are unavailable.
LiteLLM's workaround: "If upgrading is not immediately possible, block POST /guardrails/test_custom_code at your reverse proxy or API gateway."
Additional steps (Rescana guidance):
- Rotate the master key and any proxy-admin keys on deployments that ran an affected version and were reachable, starting with any key stored outside a secrets manager.
- Separate the admin API from the model API where your deployment allows it, and limit admin access to known networks.
- Do not run the proxy as root if you build your own image, and limit what the container can reach. Zenity Labs says LiteLLM ships a non-root image variant.
- If you suspect compromise, rotate every provider API key (revoke it at the provider, not only in LiteLLM) and database credential the proxy held, and any cloud or Kubernetes credentials the container could reach. Rotate LITELLM_SALT_KEY only through LiteLLM's documented procedure, because it encrypts stored credentials. Then rebuild the container from a clean image and review provider billing and usage for unexpected activity.
Indicators of Compromise
LiteLLM and CISA have published no indicators of compromise for CVE-2026-40217. The vendor's advisory identifies the vulnerable endpoint, which gives one detection lead (Rescana guidance):
- Requests to the endpoint. Search reverse proxy, gateway and LiteLLM access logs for
POST /guardrails/test_custom_code. The endpoint exists for testing guardrail code, so review every request to it: which key made it, from where, and what the proxy did next. - Known probe sources. Zenity Labs published source IPs from its April and May 2026 honeypot data, including 173.249.198.201, 108.78.4.10, 216.26.226.182 and 164.52.192.134. Its report names more, and the addresses in its text and in its list do not fully match, so check Zenity's report for the rest. Treat them as dated leads, not proof of absence.
- Admin key use. Review audit logs for proxy-admin key activity from unfamiliar addresses, and for new keys, users or guardrails you did not create.
- Container behaviour. Look for unexpected child processes of the proxy, outbound connections to hosts other than your model providers and database, and changes to files in the container.
Third-Party Risk (TPRM) Angle
AI gateways can sit inside SaaS products and service providers: a supplier's chatbot, AI feature or internal agent platform may route your data and their provider keys through LiteLLM. A compromised gateway can expose the prompts and responses that pass through it, which may include your data (Rescana guidance).
The risk concentrates in three supplier types:
- SaaS vendors with AI features that process your data through a self-hosted LiteLLM proxy.
- AI platform and consulting providers that run LiteLLM gateways for clients.
- Suppliers using products that embed LiteLLM, such as the Red Hat images above, who may not know LiteLLM is inside.
Send these three questions to suppliers whose AI features process your data (Rescana guidance):
- Do you run LiteLLM in any service that handles our data, and which version is deployed today?
- Did any deployment run a version from 1.81.8 to before 1.83.10, and if so, have you rotated the master key, proxy-admin keys and provider keys since upgrading to 1.84.0 or later?
- Who can reach the LiteLLM admin API, and have you reviewed logs for requests to
/guardrails/test_custom_code?
Ask for evidence, not reassurance: the deployed version or image digest, the date of the last key rotation, and the result of the log review. Record answers against each supplier, and follow up with any supplier that cannot say whether LiteLLM is in its stack. Our earlier advisories on CVE-2026-42271 and CVE-2026-48710 and CVE-2026-42208 cover other LiteLLM flaws worth asking about in the same message.
What to do internally: find every LiteLLM proxy, upgrade to a current pinned release, not just 1.83.11 and never 1.107.0, block the test endpoint until then, and rotate admin and provider keys on anything that was exposed. We will update this advisory if LiteLLM or CISA publishes details of the exploitation or indicators.
Need help working out which suppliers run AI gateways exposed to CVE-2026-40217? Our team can help you prioritize them and track their answers. Talk to an expert
Sources
- LiteLLM security advisory GHSA-wxxx-gvqv-xp7p: Sandbox escape in custom-code guardrail: published 6 May 2026, 19:50 EST; affected >= 1.81.8, < 1.83.10; CVSS 4.0 5.9.
- LiteLLM release v1.83.10-stable: 27 April 2026, 12:01 EST.
- PyPI JSON API: litellm: upload times for 1.83.10 and 1.83.11; latest 1.110.1 (checked 13:34 EST, 19 November 2026).
- CVE record for CVE-2026-40217 (CVE Services API): MITRE as CNA; published 10 April 2026, 08:43 EST; CVSS 3.1 8.8; CISA ADP SSVC and KEV entries.
- NVD record for CVE-2026-40217: status Analyzed; CVSS 3.1 8.8 from MITRE and Red Hat; affected range 1.81.8 to before 1.83.10 (checked 13:34 EST, 19 November 2026).
- Red Hat CSAF VEX for CVE-2026-40217, RHSA-2026:24866 and RHSA-2026:30056.
- CISA: CISA Adds Four Known Exploited Vulnerabilities to Catalog: 18 November 2026.
- CISA KEV catalog feed, JSON: version 2026.11.18 (released 14:17 EST, 18 November; checked 13:34 EST, 19 November). CVE-2026-40217 dateAdded 2026-11-18, dueDate 2026-12-02, ransomware use Unknown, CWE-420.
- Zenity Labs, "Threat Actors Are Trying to use LiteLLM's Guardrail Tester to Run Code as Root" (30 June 2026): source of the honeypot counts and probe IPs; not linked because the report reproduces captured attack payloads.
- GitHub: GHSA-2rwg-2wh4-7c4f, authenticated secret exfiltration: published 12 November 2026; checked 13:34 EST, 19 November 2026.
- Google Threat Intelligence Group: The Rise of LLMJacking: 2 November 2026.
- GTIG AI Threat Tracker: Agentic Threat Activity Crosses a Significant Threshold: 16 November 2026.
- The Hacker News: CISA Warns of 4 Exploited Flaws: 19 November 2026.
- Corgea, "CVE-2026-40217 in CISA KEV": 19 November 2026 (cited unlinked, because the page reproduces exploit code).
- LiteLLM release v1.84.0: 14 May 2026; includes pull requests #27793 and #27819, merged 13 May 2026.
- GitHub Advisory Database: GHSA-wxxx-gvqv-xp7p: reviewed entry, High, CVSS 4.0 7.5 and CVSS 3.1 8.8.



