1-minute read of a 3 min report

Exploited LiteLLM Flaw Lets Attackers Run Code in the AI Gateway

By

1-minute read

What a defender needs to know

CISA added CVE-2026-40217 to its known-exploited catalog on November 18. LiteLLM’s POST /guardrails/test_custom_code guardrail test accepts Python; bytecode rewriting can escape its hand-rolled sandbox and execute code in the proxy process. BerriAI says the process runs as root in its default Docker image. The vendor also says, “Reaching the endpoint requires a proxy-admin credential in default configurations.” Scope the credential boundary as well as network reachability.

Find running LiteLLM proxies and record their installed version and image. Check reverse-proxy and API-gateway logs for POST to /guardrails/test_custom_code, correlate unexpected requests with proxy-admin authentication, and examine proxy-host process activity when a request warrants investigation. A route hit alone is an investigation lead. BerriAI’s advisory calls >=1.83.10 patched in its version list but explicitly directs an upgrade to 1.83.11 or later in its patch instructions. Use the latter target. While upgrading, block that method and path at the edge; verify denial from a previously authorized client and confirm normal proxy traffic still passes. Inspect any other ingress that can reach the route. CISA’s KEV action date is December 2. Investigate suspicious admin activity separately from verifying the running version and access rule.

Primary sources