DEV Community

Trevor H
Trevor H

Posted on Originally published at trevorheshka.com

Exploited LiteLLM flaw puts AI keys at risk

An AI safety feature just became an attack path.

On Nov 18, CISA added LiteLLM CVE-2026-40217 to its Known Exploited Vulnerabilities catalog. LiteLLM is a popular open-source gateway that a lot of teams put in front of OpenAI, Claude, Gemini and local models.

The bug is in the custom guardrail test endpoint (/guardrails/test_custom_code). Its sandbox can be escaped, so code runs inside the proxy itself, which runs as root in the default Docker image. Attackers are already using it.

Why it matters: your LLM gateway holds every provider API key and sees every prompt. If it falls, all of that goes with it.

If you self-host LiteLLM:

  • Patch to the latest release now
  • Block POST /guardrails/test_custom_code until you do
  • Rotate your model provider keys
  • Review proxy-admin activity and logs

CISA alert: https://www.cisa.gov/news-events/alerts/2026/11/18/cisa-adds-four-known-exploited-vulnerabilities-catalog

Originally posted on LinkedIn.

Top comments (1)

Collapse
 
ahmetozel profile image
Ahmet Özel •

Putting an arbitrary custom-code test route inside the same root process that holds every upstream LLM provider key is a textbook blast-radius mistake. Gateways sit at the highest-privilege choke point of an AI stack, so any debugging or guardrail-preview feature needs strict process and credential isolation—or to live outside the serving proxy altogether.

Beyond patching and blocking the endpoint, rotating every provider key stored in that gateway is essential once a CVE hits CISA KEV, since environment variables inside a compromised root container are trivial to exfiltrate in seconds.