LiteLLM's Custom-Code Guardrail Escapes Its Own Sandbox — Now on CISA KEV (CVE-2026-40217, CVSS 8.8)

Check your own app — free, in about a minute.

The free mini-scan checks your live homepage for TLS/HTTPS basics, response security headers, cookie flags, exposed sensitive files, Firebase/Supabase backend rules, and the WordPress plugin versions your site exposes. You get a score and the finding titles — no account, no card.

Run the free mini-scan →

LiteLLM's Custom-Code Guardrail Escapes Its Own Sandbox — Now on CISA KEV (CVE-2026-40217, CVSS 8.8)

The guardrail feature meant to vet custom code became the code-execution path. LiteLLM's custom-code guardrail runs user-supplied Python inside a hand-rolled sandbox — and that sandbox can be escaped, giving arbitrary code execution in the proxy process. CISA added this flaw to its Known Exploited Vulnerabilities catalog on November 18, 2026, with exploitation marked active. That is CVE-2026-40217.

What Happened

CVE-2026-40217 is an arbitrary code execution vulnerability in LiteLLM (BerriAI), classified CWE-420 (Unprotected Alternate Channel). The original research advisory is X41 D-Sec's x41-2026-001.

Am I Affected?

Check your lockfile and your image — not your deployed pages. You are in the affected set if you run a LiteLLM proxy at >= 1.81.8 and < 1.83.10. Reaching the endpoint needs a proxy-admin credential in default configurations, which caps but does not erase the risk: admin credentials leak, and a KEV listing means someone is exploiting this.

One honesty note, because it decides where you should look: a URL scan cannot version-check LiteLLM. A deployed app does not passively disclose which LiteLLM version its backend runs — or whether it runs LiteLLM at all. The version lives in the lockfile and the image (pip show litellm, your requirements file, your container digest), and that is where this question gets answered. Probing the guardrail endpoint itself would mean actively exercising a code-execution endpoint, which a passive scan never does. What the free mini-scan can do is check the rest of your live app's exposed surface while you handle this one in the deployment.

What To Do Now

  1. Upgrade to the newest 1.83.x release. The GHSA's structured field names 1.83.10 as the first patched version and its prose advises 1.83.11 or later — take the newest available 1.83.x and the discrepancy stops mattering.
  2. If you cannot upgrade today, use the GHSA's own workaround: block POST /guardrails/test_custom_code at the reverse proxy or API gateway.
  3. Rotate and audit proxy-admin credentials. The stated precondition is a proxy-admin credential; if one has leaked, the sandbox was the only thing standing behind it, and it did not hold.
  4. Redeploy. A dependency fix that never ships changes nothing — confirm the running image, not just the lockfile, carries the fixed version.

The Bigger Lesson

A sandbox you hand-roll around arbitrary code execution is a security boundary you now own. LiteLLM's fix replaced the hand-rolled sandbox with RestrictedPython — a maintained sandboxing library — for a reason: bytecode-level escapes are exactly the class of attack a bespoke sandbox is least likely to anticipate. If a feature's job is to run other people's code safely, the sandbox is the product's security boundary, and it deserves the same scrutiny as authentication.

Related: Vibe-Coded App Security Patterns — the recurring failure shapes behind findings like this one. How to Check If Your Web App Is Hacked — the follow-up pass if a review finds something you can't explain.


Running a LiteLLM proxy? Check your lockfile and image against the range above, upgrade to the newest 1.83.x, then run the free check at preshipit.com/free-scan — it covers the live app's exposed surface, and articles like this one cover the parts a scan can't see.

The PreShipIt Brief — a short weekly email for people shipping vibe-coded apps: the week's important vulnerabilities and launch-safety checks, in plain English.

New and free. Double opt-in: we email you a confirmation link before anything else arrives. Unsubscribe any time.

Check your own app — free, in about a minute.

The free mini-scan checks your live homepage for TLS/HTTPS basics, response security headers, cookie flags, exposed sensitive files, Firebase/Supabase backend rules, and the WordPress plugin versions your site exposes. You get a score and the finding titles — no account, no card.

Run the free mini-scan →

← Back home · Run a free mini-scan · Scan my app — $29 · See a sample report