What happened
BerriAI LiteLLM's POST /guardrails/test_custom_code endpoint runs user-supplied Python inside a hand-rolled sandbox that can be escaped with bytecode-level techniques, giving arbitrary code execution in the proxy process (which runs as root in the default Docker image). It was added to the CISA KEV catalog on 2026-11-18 with confirmed in-the-wild exploitation. The advisory notes the endpoint needs a proxy-admin credential in default configurations, but the observed exploitation chains a low-privilege virtual-key user into this escape to elevate to admin and execute code.
Why it matters
LiteLLM is a widely deployed AI gateway/proxy in front of many LLM applications; it holds model API keys and per-tenant virtual keys. An attacker who can reach the guardrail test endpoint can execute arbitrary code as the proxy process (root in default container), then read all upstream provider credentials, impersonate any tenant, and manipulate model routing — a full compromise of the AI gateway, not just one chatflow.
Attack vector
POST /guardrails/test_custom_code with bytecode-level sandbox escape → arbitrary code execution in the proxy process as root; exploited in the wild to escalate from limited virtual keys to admin/RCE.
Affected systems
LiteLLM proxy before 1.83.11 (custom-code guardrail); fixed in 1.83.11 (RestrictedPython replaces hand-rolled sandbox)
Mitigation
Upgrade to LiteLLM 1.83.11 or later; if not possible immediately, block POST /guardrails/test_custom_code at the reverse proxy/API gateway; treat any virtual-key compromise as host compromise.