Security

LiteLLM CVE-2026-40217 Added to CISA KEV: What to Do

CISA added LiteLLM CVE-2026-40217 to its KEV catalog on Nov 18, 2026 after exploitation. Teams running an AI gateway should check versions, patch and rotate keys.

Trị Trương · 7 min read
LiteLLM CVE-2026-40217 Added to CISA KEV: What to Do

On November 18, 2026, the US Cybersecurity and Infrastructure Security Agency (CISA) added LiteLLM CVE-2026-40217 to its Known Exploited Vulnerabilities (KEV) catalog, the list of flaws with evidence of exploitation in the wild. LiteLLM often sits in front of several AI models as a gateway, so a flaw there can mean leaked API keys, a hijacked server and an abused AI bill. This article covers what is confirmed, where sources disagree and what to do.

What is LiteLLM and why does it matter?

LiteLLM is an open-source proxy that lets applications call many language-model providers through one interface while managing virtual keys, quotas and costs. Many development teams run it as an internal AI gateway where the keys for OpenAI, Anthropic, Google and others are concentrated. Whoever takes the gateway usually gets the whole key ring.

Technical details of LiteLLM CVE-2026-40217

According to LiteLLM’s own security advisory on GitHub (GHSA-wxxx-gvqv-xp7p), the bug sits in the POST /guardrails/test_custom_code endpoint. It runs user-supplied Python in a hand-rolled sandbox that can be escaped with bytecode-level techniques, allowing arbitrary code execution in the proxy process. In the default Docker image the proxy runs as root. The weakness is classed as CWE-913 (improper control of dynamically-managed code resources), and the KEV entry describes it as an “unprotected alternate channel” leading to remote code execution.

Zenity Labs gives an easier picture: the sandbox is effectively a keyword deny-list. Attackers get around it by building blocked names such as __globals__ at runtime through string concatenation, then use generator or coroutine internals to reach built-in functions and import libraries like os or subprocess.

Affected versions and the fix

  • Affected: LiteLLM from 1.81.8 up to, but not including, 1.83.10.
  • Fixed version: the advisory header lists 1.83.10, but its Patches section says to upgrade to 1.83.11. Go to 1.83.11 or later to be safe. Zenity recommends a current pinned release, and another analysis says 1.84.0 also fixes related flaws.
  • How it was fixed: the hand-rolled sandbox was replaced with RestrictedPython.
  • Workaround: if you cannot upgrade yet, block POST /guardrails/test_custom_code at your reverse proxy or API gateway.

CVSS scores and exploitation conditions

The severity is rated differently depending on who you ask. Per the advisory, LiteLLM rates it Moderate (5.9, CVSS 4.0), the CVE record and NVD (from MITRE and Red Hat) list 8.8 under CVSS 3.1, and GitHub’s reviewed entry says 7.5 (CVSS 4.0). The gap relates to a prerequisite: the advisory says exploitation requires a proxy-admin credential in default configurations. Zenity likewise notes that an attacker needs a valid master key to reach the endpoint.

That does not make you safe. Zenity’s honeypots logged 569 POST requests to the endpoint between April 15 and May 24, 2026. The attackers tried default master keys such as sk-1234 and sk-changeme, then moved to payloads that read environment variables (which hold provider and cloud keys) and run operating-system commands. Public proof-of-concept code has also reportedly been on GitHub since May 2026.

The November 18 KEV listing and Google’s report

According to trackers such as Rescana, CISA added the flaw to KEV on November 18, 2026, with a federal remediation deadline of December 2, 2026. We could not load CISA’s own page to cross-check, so verify against the official catalog. The same source says CISA lists ransomware use as unknown.

A November 2, 2026 report from Google Threat Intelligence Group (GTIG), as summarized by Rescana, describes an LLMjacking intrusion: attackers bought ordinary LiteLLM virtual keys and escalated them to proxy-admin credentials on the victim’s gateway. LLMjacking means taking over someone’s AI model account to run workloads for free while the victim pays. GTIG attributes that escalation to CVE-2026-40217 and describes it as a user ID rebind in the /key/regenerate endpoint. Corgea’s analysis, however, argues the rebind is a separate bug fixed in 1.84.0, and the sources do not settle which flaw was used. The safe course is to upgrade to the latest pinned release rather than just to 1.83.11.

Timeline from disclosure to KEV

Date Event (source)
April 10, 2026 Flaw disclosed (Zenity)
April 15, 2026 Fix in 1.83.10; honeypots record the first probes the same day (Zenity)
April 15 to May 24 569 POST requests to the endpoint logged (Zenity)
May 7, 2026 GitHub advisory published (GitHub)
November 2, 2026 Google GTIG report on an LLMjacking intrusion (via Rescana)
November 18, 2026 CISA adds the flaw to KEV; federal deadline December 2 (via Rescana)

The gap between the early fix and the late KEV listing is worth noticing. The flaw had been patched for months before CISA flagged confirmed exploitation, which means many deployments that never updated were exposed for the whole period. Gateways installed once and forgotten are exactly the kind of system that falls into this gap.

Why a “sandbox escape” is serious, in plain language

A guardrail tester endpoint exists so administrators can try out custom checks on AI requests. To do that it has to run code someone typed in. A sandbox is supposed to fence that code in so it cannot touch the real system. Here the fence was a list of forbidden words, and attackers found ways to spell those words at runtime so the fence did not recognize them. Once outside the fence, the code runs with the proxy’s own rights, and in the default container that means root, with access to environment variables, configuration files and anything the container can reach on the network.

The lesson goes beyond LiteLLM. Any feature that executes user-supplied code is high risk, and deny-lists rarely hold up against determined attackers. That is why the fix replaced the home-made sandbox with an established library, RestrictedPython, instead of lengthening the list.

Not the first LiteLLM flaw in KEV

Security Affairs reports that CISA had already listed another LiteLLM flaw, CVE-2026-42208, in May 2026. It is a SQL injection in API key verification (CVSS 9.3) affecting versions 1.81.16 through 1.83.6, fixed in 1.83.7. Sysdig saw the first exploitation attempt about 36 hours after the advisory, targeting the tables that hold virtual keys and provider credentials. Together the two cases show attackers going straight for the place AI keys are stored.

Why small businesses should care

  • Many companies build chatbots or internal tools on open-source AI gateways, often installed by one developer and rarely monitored.
  • The gateway holds keys for several providers at once; losing it means losing all of them.
  • AI API costs are usage-based, so abuse can produce a surprising bill before anyone notices.
  • Default keys such as sk-1234 still turn up in practice, according to Zenity’s honeypot data.

The broader pattern shows up in the recent wave of AI agent cyberattacks that walk in through forgotten keys and exposed APIs: attackers go where the keys are, no exotic technique required.

What to do

To deal with LiteLLM CVE-2026-40217, work through these steps in order.

  1. Inventory where LiteLLM or a similar AI gateway runs, which version and who owns it.
  2. Upgrade to 1.83.11 or later, ideally the latest pinned release, after reading the developer’s advisory.
  3. Block the endpoint /guardrails/test_custom_code at the reverse proxy if you cannot upgrade immediately.
  4. Replace the master key if it is a default or guessable value, and rotate proxy-admin keys.
  5. Separate the admin plane from the model API and restrict it with a VPN or IP allow-list; do not expose the gateway to the internet unless required.
  6. Run the proxy as a non-root user to limit the damage of a sandbox escape.
  7. If you suspect compromise: rotate AI provider keys, database passwords and any cloud or Kubernetes credentials the gateway can reach, then rebuild from a clean image.
  8. Set spending limits and anomaly alerts on AI provider accounts, and review access logs for odd requests.

According to Rescana, neither LiteLLM nor CISA has published indicators of compromise, so log review relies on signs such as requests to the endpoint above, unusual admin-key activity and cost spikes. If you are bringing AI into your workflows and want key permissions designed safely from day one, see our AI and automation solutions.

FAQ

I only use LiteLLM as a Python library. Am I affected?

The advisory concerns the LiteLLM proxy and the endpoint above. If you do not run the proxy, your risk differs; read the official advisory and confirm whether any proxy is running.

The bug needs admin credentials, so is it really dangerous?

For LiteLLM CVE-2026-40217, yes: default or weak master keys are being tried in the wild, and Google reports attackers escalating ordinary keys to admin. A bug that needs high privilege is still dangerous when privilege control is loose.

Do I need to rotate keys after upgrading?

If the gateway was ever reachable from the internet or used default keys, rotate them even after patching, because an attacker may already have copied them.

What does KEV mean for a private company?

KEV is CISA’s statement that the flaw is being exploited. The deadline binds only US federal agencies, but private organizations should treat it as top patching priority.

Need someone to review your AI gateway, servers and key-management process? See our system maintenance and security service or get in touch.

Sources: LiteLLM Security Advisory (GitHub), Zenity Labs, Rescana, Security Affairs

Taking on new projects

Let’s build
what’s next.

You have the idea. We have the technology to make it real.

Phone / WhatsApp
096.279.2345
You need

We only use this to get back to you.

Chat on WhatsApp Call +84 96 279 2345