⌁AI·CYBER·BRIEF▌
Vulnerabilities6 min read

LiteLLM sandbox escape now exploited in LLMjacking attacks: CISA adds CVE-2026-40217 to KEV

Attackers abused a LiteLLM guardrail sandbox escape to take over AI gateways and their keys, Google says. CISA set a Dec. 2 deadline. Upgrade and block the endpoint.

The US Cybersecurity and Infrastructure Security Agency (CISA) added CVE-2026-40217, a sandbox escape in the LiteLLM AI gateway, to its catalog of actively exploited vulnerabilities on November 18, 2026, after Google reported criminals using it to steal and resell AI access. Anyone running a self-hosted LiteLLM proxy between 1.81.8 and 1.83.10 is affected. Upgrade to a current release, block the vulnerable test endpoint, and rotate keys if your gateway was exposed.

What happened, in plain English

LiteLLM is an open-source "AI gateway": a proxy server that companies put in front of their AI providers (OpenAI, Anthropic, Google, Azure and others). Apps call one endpoint, and LiteLLM handles routing, spending limits and the internal "virtual keys" it hands out to teams. That also means the gateway holds the real provider API keys behind it.

One LiteLLM feature lets administrators write small custom "guardrails", rules in Python that check prompts or responses. To try a rule before saving it, there is a test button backed by an HTTP endpoint, /guardrails/test_custom_code. The code submitted there runs inside a homemade sandbox that is supposed to block anything dangerous.

Researcher Markus Vervier of the German firm X41 D-Sec found that this sandbox could be escaped. Whoever can reach the endpoint can run their own code on the server, and in LiteLLM's default Docker image that code runs as root (the all-powerful administrator account on Linux).

Think of a bank that lets staff test a new rule in a "safe room", but the safe room has a back door into the vault.

The bug was published in April and fixed in May. What changed this week: Google's Threat Intelligence Group (GTIG) reported on November 16 that a threat actor used it in "LLMjacking" intrusions, attacks that steal AI access and resell or abuse it, to turn limited-access virtual keys into full administrator credentials. Two days later CISA listed it in its Known Exploited Vulnerabilities (KEV) catalog, which means exploitation in the wild is confirmed.

Are you affected? What to do now

Affected: self-hosted LiteLLM proxy (the litellm Python package or the official container) from 1.81.8 up to, but not including, 1.83.10, according to LiteLLM's GitHub advisory. If you only use LiteLLM as a Python library inside your app, without running the proxy server, the vulnerable endpoint is not exposed. Most people who never installed LiteLLM have nothing to do.

Checklist

  • Find every LiteLLM proxy you run. Include test boxes, developer laptops exposed via tunnels, and containers launched by AI tools. Check the version with pip show litellm inside the environment, or look at the container image tag.
  • Upgrade. The advisory's table says 1.83.10 fixes the flaw, while its text says "Fixed in 1.83.11". Go past both: move to a current release (PyPI listed 1.110.2 as the newest version when we checked on November 20, 2026). The fix replaced the homemade sandbox with RestrictedPython, a maintained library for running limited Python.
  • If you cannot upgrade today, block the endpoint. LiteLLM's documented workaround is to block POST /guardrails/test_custom_code at your reverse proxy or API gateway.
  • Keep the admin interface off the internet. X41 also advises limiting admin API access to trusted administrators, keeping the admin port off untrusted networks, and not running the container as root.
  • Look for signs of use. Search proxy and reverse-proxy logs for requests to /guardrails/test_custom_code, especially from addresses or keys that are not your admins. Check for virtual keys or admin users you did not create, and for unusual AI spend. No official indicators of compromise (IOCs) have been published for this campaign.
  • If you find anything, or your proxy was exposed and unpatched for months, assume the keys are gone. Our recommendation: rotate the LiteLLM master key, all virtual keys, every upstream provider API key stored in the gateway, and the database credentials. Then set spending caps and alerts with each AI provider.

US federal civilian agencies must act by December 2, 2026 under CISA's directive. Everyone else should treat that date as a ceiling, not a target.

The expert view

Root cause. This is a textbook case of why denylist sandboxes for an interpreted language fail. According to X41's advisory, the guardrail runner filtered submitted code with regular expressions. Python exposes its bytecode and object model to running code, so filtering text cannot describe everything the interpreter will actually do. X41 bypassed the filter with bytecode rewriting. The vendor's fix, moving to RestrictedPython, is better, but running tenant-supplied code inside the gateway process remains a design choice that deserves scrutiny. Isolation (separate process, no secrets, no root) is what actually contains it.

Why it is worse than the score suggests. The CVSS scores (Common Vulnerability Scoring System) disagree sharply:

  • LiteLLM's GitHub advisory: 5.9, Moderate (CVSS 4.0), assuming high privileges are needed. Its text says a proxy-admin credential is required "in default configurations".
  • X41: 8.7, High (CVSS 4.0), assuming low privileges, only an authenticated request.
  • GitLab's advisory database and secondary reporting: 8.8, High (CVSS 3.1).

GTIG's description of the real attacks supports the higher reading. It says the actor used the flaw to escalate limited virtual keys into full administrative credentials. Either the endpoint was reachable with low privileges in those deployments, or the attackers combined it with something else. GTIG does not say which, and it names neither the actor nor any victims. The blast radius matters too. A gateway is a credential vault by design: it holds the provider keys, the spend controls and often the prompt logs. Code execution as root there turns into a stolen key ring, which is exactly what LLMjacking crews monetize.

Disclosure timeline. X41 reported the bug on February 13, 2026. After weeks of follow-ups, a failed delivery to the vendor's technical contact and an escalation to the Linux distributions' security list, X41 published on April 8 with no patch available. LiteLLM published its advisory on May 7. Exploitation confirmed by Google and CISA came about six months after the fix, a reminder that self-hosted AI infrastructure is often installed once and rarely updated.

The broader trend. LiteLLM has been a recurring target this autumn: a poisoned release in October, an unpatched JWT login flaw, and AI agents raiding exposed LiteLLM, Dify and Ollama servers, reported by Amazon. This listing follows CISA's KEV entry for the GPUStack login bypass earlier this month, and the exploitation was reported in the same Google AI Threat Tracker report that described agents turning patches into exploits automatically. AI middleware should now be patched and monitored with the same urgency as VPNs and identity providers.

Still unknown: how many LiteLLM instances were compromised, whether the exploited deployments ran non-default configurations, which actor is responsible, and whether this flaw was chained with other LiteLLM bugs. CISA marks ransomware use as "Unknown".

Official sources

Get the daily brief

AI + security signal by email: headlines, a two-line summary, a link. No noise, no spam.

How often