Skip to content
Cisent Message us on WhatsAppMessage us

Blog & news

Threat researchCisent

LiteLLM: a flaw that lets attackers run code on the AI gateway is now being exploited

CISA added to its catalog of exploited flaws a vulnerability in LiteLLM, the open-source AI gateway, that allows code execution on the server and has had a patch since May.

On November 18, CISA added CVE-2026-40217 to its catalog of actively exploited vulnerabilities.1 It is a flaw in LiteLLM, an open-source proxy that sits between applications and AI models, with a single API for more than 100 model providers.2 It is the same tool whose malicious versions led Chile’s cybersecurity agency, ANCI, to alert some twenty Chilean institutions, as we reported on August 14.

What fails

  • LiteLLM has an API endpoint, POST /guardrails/test_custom_code, for testing custom “guardrails”: Python code that filters what goes into and out of the models.3
  • That code ran inside a hand-rolled sandbox that filtered the text with regular expressions. X41 D-Sec showed it can be escaped by rewriting Python bytecode, to run any command on the server.2
  • In the default Docker image, the process runs as root.3
  • According to LiteLLM’s advisory, reaching that endpoint requires a proxy-admin credential in default configurations.3 The NVD scores it 8.8 out of 10.4

How long it took

  • X41 D-Sec found the flaw on February 13, and the embargo it agreed on for publishing it ran out on April 8.2
  • LiteLLM published its advisory with the fix on May 11.3
  • Six months later, CISA lists it as exploited.1

What CISA says

  • It gives US federal agencies until December 2 to apply the vendor’s mitigations, or to stop using the product if none are available.1
  • It does not say who is exploiting it or against whom, and it marks its use in ransomware campaigns as unknown.1

What to do

  • Upgrade to version 1.83.11 or later, where the hand-rolled sandbox was replaced with RestrictedPython. The advisory’s text asks for 1.83.11, although its metadata lists 1.83.10 as the first fixed version.3
  • If you cannot upgrade right away, block POST /guardrails/test_custom_code at the reverse proxy or the API gateway.3

Where Cisent comes in

Until it is patched, LiteLLM recommends closing that endpoint at the API gateway, before requests reach the proxy.3

Sentinel Red Team attacks the organization’s systems with its authorization and within the scope it defines, to find the gaps before an attacker does: the admin panel exposed on a server nobody watches, the service published by mistake, the insecure configuration. It’s ongoing testing, not one audit a year, and every new attack pattern helps train the defense.

Explore Sentinel Red Team

Sources

  1. CISA, “Known Exploited Vulnerabilities Catalog”, CVE-2026-40217 entry, November 18, 2026. https://www.cisa.gov/known-exploited-vulnerabilities-catalog↩︎

  2. Markus Vervier, “Advisory X41-2026-001: Guardrail Sandbox Escape in LiteLLM”, X41 D-Sec, April 2026. https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm/↩︎

  3. BerriAI, “LiteLLM has a sandbox escape in custom-code guardrail” (GHSA-wxxx-gvqv-xp7p), GitHub security advisory, May 11, 2026. https://github.com/BerriAI/litellm/security/advisories/GHSA-wxxx-gvqv-xp7p↩︎

  4. NIST, “CVE-2026-40217”, National Vulnerability Database, April 10, 2026. https://nvd.nist.gov/vuln/detail/CVE-2026-40217↩︎