Blog

LiteLLM CVE-2026-40217 is on CISA's exploited list: what AI gateway operators should do this week

TechScripts Nepal · Kathmandu · November 25, 2026 · 5 min read

On November 18, CISA added CVE-2026-40217, a flaw in the LiteLLM AI gateway, to its Known Exploited Vulnerabilities catalog. That listing means CISA has evidence of attacks in the wild. US federal agencies have a deadline to fix it, which a secondary report puts at December 2, and everyone else should treat the listing as a strong signal to act.

LiteLLM is a popular open-source proxy that sits between an organisation's applications and its AI model providers. It holds the provider API keys, issues "virtual keys" to internal teams and tracks spending. That makes it a valuable target: whoever controls the gateway controls the keys behind it.

This is the second LiteLLM incident we've covered in a month, after the poisoned 1.107.0 release in October.

What the flaw is, according to LiteLLM

LiteLLM's own security advisory (GHSA-wxxx-gvqv-xp7p) describes a sandbox escape in the custom-code guardrail feature:

  • The endpoint POST /guardrails/test_custom_code runs Python supplied by the caller inside a sandbox LiteLLM wrote itself.
  • That sandbox can be escaped, giving arbitrary code execution in the proxy process. LiteLLM notes the process runs as root in the default Docker image.
  • In default configurations, reaching the endpoint requires a proxy-admin credential.
  • The fix replaced the home-made sandbox with the RestrictedPython library.

LiteLLM lists affected versions as 1.81.8 up to, but not including, 1.83.10. The advisory is inconsistent about the first fixed release. Its version field says 1.83.10, while its text says to upgrade to 1.83.11 or later. LiteLLM rates the bug Moderate (CVSS 4.0 score 5.9), largely because an attacker needs admin access first. A secondary report says the CVE record carries a higher CVSS 3.1 score of 8.8, which we couldn't confirm on NVD.

Where the accounts disagree

On November 3, Google's Threat Intelligence Group published research on "LLMJacking", meaning attackers stealing access to AI models. It described attackers who reached a victim's LiteLLM gateway and used CVE-2026-40217 to turn ordinary virtual keys into full proxy-admin credentials. Google described that as a user-ID rebind in the /key/regenerate endpoint. That is a different weakness from the guardrail sandbox in LiteLLM's advisory.

We can't resolve this from public sources. One analysis cited by the security firm Rescana treats the key-regeneration issue as a separate bug fixed in 1.84.0. Either the CVE number is being used for two problems, or one of the descriptions is wrong. CISA's catalog entry, titled "Unprotected Alternate Channel", doesn't settle it either.

Practically, the two accounts fit together uncomfortably well. LiteLLM's bug needs an admin key, and Google's report shows attackers obtaining admin keys. A path from "someone has an ordinary key" to "someone runs code as root on the gateway" is plausible either way. That is how we'd plan for it.

This isn't the only recent chain. In June, a Cloud Security Alliance research note summarised work by Obsidian Security describing a chain in which an internal user could raise their own role to admin (CVE-2026-47101 and CVE-2026-47102), then use this guardrail bug to run code. A separate LiteLLM flaw, CVE-2026-42271, joined CISA's catalog on June 8. LiteLLM's advisory page also lists newer critical and high-severity issues from September to November.

What to do

  1. Find every LiteLLM instance. Include the ones a team stood up for a prototype and forgot about. Check versions with pip show litellm or the image tag.
  2. Upgrade to a current, pinned release. Don't stop at the minimum fixed version, given the disagreement above and the other recent advisories. Pin the exact version, and never use 1.107.0, the compromised release from October.
  3. Block the endpoint if you can't upgrade today. LiteLLM's own workaround is to block POST /guardrails/test_custom_code at your reverse proxy or API gateway.
  4. Keep the admin surface private. The admin UI and management endpoints (/key/*, /user/*, /guardrails/*) should not be reachable from the internet. Make sure a master key is configured.
  5. Rotate secrets if the gateway was exposed. If an instance on an affected version was reachable from the internet, assume its keys may be known. Rotate the master key, proxy-admin keys and the AI provider keys the gateway holds. This is cautious advice from security researchers, not a vendor requirement.
  6. Check your logs and bills. Look for requests to /guardrails/test_custom_code and /key/regenerate, keys gaining admin rights, and unexpected spikes in model usage or spend. Neither LiteLLM nor CISA has published indicators of compromise.

The bigger pattern

AI gateways have become infrastructure. They hold the most valuable credentials in an AI stack, and they're often deployed fast, by a team running an experiment, without the hardening a payment system would get. This year LiteLLM has had a poisoned release, two flaws on CISA's exploited list and several critical advisories. That doesn't mean it's unusually bad; it is widely used and well scrutinised. It does mean the gateway deserves the same patching and access discipline as any other internet-facing system that holds secrets.

If you're not sure what's sitting between your applications and your AI providers, start by writing it down: which gateways, which versions, who can reach the admin endpoints, and which keys they hold. That inventory is most of the work. If your team doesn't have time for it, that kind of short, contained review is something we do for clients. We also build private AI systems where the keys and data stay inside your own network to begin with.