# BerriAI LiteLLM guardrail sandbox escape RCE (CVE-2026-40217) added to CISA KEV · pwn.watch > CISA added CVE-2026-40217 (GHSA-wxxx-gvqv-xp7p, CVSS 8.8 High), a remote code execution vulnerability in BerriAI LiteLLM, to the Known Exploited Vulnerabilities catalog on Nov 18, 2026. The flaw allows remote attackers to escape the custom-code guardrail sandbox via bytecode rewriting at the /guardrails/test_custom_code endpoint. Affected versions 1.81.8 through 1.83.9; fixed in LiteLLM 1.83.10. Page: https://pwn.watch/i/litellm-custom-code-guardrail-rce-cve-2026-40217 · generated 2026-12-03T23:11:28.246Z ## Status - Severity: critical · status: live · patch: patched - Product: BerriAI LiteLLM - Started: 2026-04-10 - CVEs: CVE-2026-40217 - Affected: litellm >= 1.81.8, < 1.83.10 - Fixed in: litellm 1.83.10 (v1.83.10-stable) ## Follow this incident - RSS (one item per update): https://pwn.watch/i/litellm-custom-code-guardrail-rce-cve-2026-40217/feed.xml - JSON Feed: https://pwn.watch/i/litellm-custom-code-guardrail-rce-cve-2026-40217/feed.json - Full data (timeline, sources, posts, agentBrief): https://pwn.watch/i/litellm-custom-code-guardrail-rce-cve-2026-40217.json - This file: https://pwn.watch/i/litellm-custom-code-guardrail-rce-cve-2026-40217/llms.txt ## Updates (newest first) - 2026-11-18: CISA adds CVE-2026-40217 to the KEV catalog based on evidence of active exploitation. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-40217) - 2026-05-11: BerriAI publishes GHSA-wxxx-gvqv-xp7p and fixes the guardrail sandbox escape in LiteLLM v1.83.10-stable. (https://github.com/BerriAI/litellm/security/advisories/GHSA-wxxx-gvqv-xp7p) - 2026-04-10: CVE-2026-40217 is published for bytecode-rewriting RCE at LiteLLM's /guardrails/test_custom_code endpoint. (https://nvd.nist.gov/vuln/detail/CVE-2026-40217) ## Fix brief # Security brief: BerriAI LiteLLM guardrail sandbox escape RCE (CVE-2026-40217) added to CISA KEV Source: https://pwn.watch/i/litellm-custom-code-guardrail-rce-cve-2026-40217 · status: live · severity: critical · updated Dec 3, 2026, 22:55 UTC ## Patch status **PATCHED: fixed releases exist. Upgrade to a fixed version.** ## What it is CISA added CVE-2026-40217 (GHSA-wxxx-gvqv-xp7p, CVSS 8.8 High), a remote code execution vulnerability in BerriAI LiteLLM, to the Known Exploited Vulnerabilities catalog on Nov 18, 2026. The flaw allows remote attackers to escape the custom-code guardrail sandbox via bytecode rewriting at the /guardrails/test_custom_code endpoint. Affected versions 1.81.8 through 1.83.9; fixed in LiteLLM 1.83.10. Severity detail: CVSS 8.8 High; actively exploited in the wild (CISA KEV Nov 18, 2026) - Product: BerriAI LiteLLM - CVE / advisory ids: CVE-2026-40217 ## Affected versions - litellm >= 1.81.8, < 1.83.10 ## Check whether you're affected Run these where the product is installed or in the project that depends on it, then compare with the affected/fixed versions: ```sh pip show litellm docker images | grep -i litellm ``` ## Fix Upgrade to one of these fixed versions (or later on the same branch): - litellm 1.83.10 (v1.83.10-stable) After upgrading, re-run the checks above and redeploy/restart the affected services. ## Secrets to rotate This incident involves possible credential exposure. Rotate any credentials (API keys, tokens, env vars, SSH keys) that were present on affected systems or in affected builds while vulnerable/compromised versions were installed, and review access logs. ## Specific notes Upgrade LiteLLM immediately to `>= 1.83.10` (`pip install --upgrade 'litellm>=1.83.10'`). Audit proxy logs for requests to `/guardrails/test_custom_code` and rotate all upstream LLM provider API keys (OpenAI, Anthropic, Bedrock, Vertex) stored in LiteLLM if an affected proxy was exposed. ## Latest updates - Nov 18, 2026: CISA adds CVE-2026-40217 to the KEV catalog based on evidence of active exploitation. - May 11, 2026: BerriAI publishes GHSA-wxxx-gvqv-xp7p and fixes the guardrail sandbox escape in LiteLLM v1.83.10-stable. - Apr 10, 2026: CVE-2026-40217 is published for bytecode-rewriting RCE at LiteLLM's /guardrails/test_custom_code endpoint. ## Advisories - [GHSA-wxxx-gvqv-xp7p: LiteLLM has a sandbox escape in custom-code guardrail](https://github.com/BerriAI/litellm/security/advisories/GHSA-wxxx-gvqv-xp7p) (GitHub Security Advisories) - [CVE-2026-40217 Detail](https://nvd.nist.gov/vuln/detail/CVE-2026-40217) (NVD) ## Write-ups & news - [X41-2026-001: LiteLLM Custom-Code Guardrail Sandbox Escape](https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm) --- Machine-readable: https://pwn.watch/i/litellm-custom-code-guardrail-rce-cve-2026-40217.json · all incidents: https://pwn.watch/incidents.json. Verify against the vendor advisory before changing production systems.