CVE-2026-40217 HIGH · CVSS 8.8 · BerriAI — LiteLLM proxy (AI gateway) ·

CVE-2026-40217: POST /guardrails/test_custom_code custom-code guardrail sandbox (per CISA/GHSA); GTIG links the ID to a /key/regenerate user-ID rebind

CISA and the LiteLLM advisory describe a bytecode-level escape from the hand-rolled Python sandbox behind POST /guardrails/test_custom_code, giving arbitrary code execution in the proxy process (root in the default Docker image). Google Threat Intelligence attributes the same CVE ID to a /key/regenerate user-ID rebind that LLMjacking actors used to turn standard virtual keys into PROXY_ADMIN credentials. CISA added it to KEV on 2026-11-18.

Identifier
CVE-2026-40217
Vendor / Product
BerriAI · LiteLLM proxy (AI gateway)
Severity / CVSS
HIGH · CVSS 8.8
Vector / CWE
CWE-420 (Unprotected Alternate Channel) per CISA; CWE-913 per GHSA
Network. The guardrail endpoint needs a proxy-admin credential in default configurations; GTIG observed attackers escalating standard virtual keys to PROXY_ADMIN via /key/regenerate. Code runs as root in the default Docker image.
Affected
LiteLLM >= 1.81.8, < 1.83.10 (GHSA-wxxx-gvqv-xp7p); /key/regenerate rebind hardened in 1.84.0
Patched Version
LiteLLM 1.83.11 (sandbox replaced with RestrictedPython); 1.84.0+ recommended (adds /key/regenerate ownership-rebind guards)
Priority
P1: in CISA KEV since 2026-11-18 (federal due date 2026-12-02); used in LLMjacking campaigns

Executive Summary & Technical Impact

CISA and the LiteLLM advisory describe a bytecode-level escape from the hand-rolled Python sandbox behind POST /guardrails/test_custom_code, giving arbitrary code execution in the proxy process (root in the default Docker image). Google Threat Intelligence attributes the same CVE ID to a /key/regenerate user-ID rebind that LLMjacking actors used to turn standard virtual keys into PROXY_ADMIN credentials. CISA added it to KEV on 2026-11-18.

Tracked under CVE-2026-40217 (CWE-420 (Unprotected Alternate Channel) per CISA; CWE-913 per GHSA), this vulnerability affects LiteLLM >= 1.81.8, < 1.83.10 (GHSA-wxxx-gvqv-xp7p); /key/regenerate rebind hardened in 1.84.0 and carries a severity score of 8.8 (HIGH). Engineering and security operations teams running LiteLLM proxy (AI gateway) should prioritize upgrading to LiteLLM 1.83.11 (sandbox replaced with RestrictedPython); 1.84.0+ recommended (adds /key/regenerate ownership-rebind guards).

Remediation & Patch Guidance

  1. Upgrade LiteLLM to 1.84.0 or later, which covers both the guardrail sandbox fix and the /key/regenerate ownership-rebind guards.
  2. If you cannot upgrade immediately, block POST /guardrails/test_custom_code at the reverse proxy or API gateway and keep management endpoints off public listeners.
  3. Rotate the master key, admin virtual keys and stored provider keys if the proxy was exposed, and review cloud billing/quota for new keys or GPU instances.

Frequently Asked Questions (CVE-2026-40217)

What versions are affected by CVE-2026-40217?

CVE-2026-40217 affects LiteLLM >= 1.81.8, < 1.83.10 (GHSA-wxxx-gvqv-xp7p); /key/regenerate rebind hardened in 1.84.0 in LiteLLM proxy (AI gateway) (POST /guardrails/test_custom_code custom-code guardrail sandbox (per CISA/GHSA); GTIG links the ID to a /key/regenerate user-ID rebind).

How do I patch or remediate CVE-2026-40217?

Upgrade affected deployments to LiteLLM 1.83.11 (sandbox replaced with RestrictedPython); 1.84.0+ recommended (adds /key/regenerate ownership-rebind guards) and verify the remediation steps listed above.

What is the CVSS score of CVE-2026-40217?

CVE-2026-40217 is rated HIGH with a CVSS score of 8.8 (vector: Network. The guardrail endpoint needs a proxy-admin credential in default configurations; GTIG observed attackers escalating standard virtual keys to PROXY_ADMIN via /key/regenerate. Code runs as root in the default Docker image.).

Full TechPulse Investigation

LiteLLM CVE-2026-40217 Joins CISA KEV as Google Ties It to LLMjacking Attacks

CISA added the LiteLLM proxy flaw to its Known Exploited Vulnerabilities catalog on November 18, 2026, after Google Threat Intelligence described attackers turning ordinary virtual keys into full proxy-admin credentials. The sources don't agree on which endpoint the CVE covers, so the safe move is to upgrade past both fixes: LiteLLM 1.84.0 or later.

Read full engineering post-mortem (5 min read) →

Official Vendor & NVD Advisory Links

  1. CISA KEV alert (Nov 18, 2026)
  2. GHSA-wxxx-gvqv-xp7p
  3. GTIG — The Rise of LLMJacking
  4. NVD — CVE-2026-40217