# LiteLLM: CISA adds the guardrail sandbox escape to its exploited list

> CVE-2026-40217 lets a LiteLLM proxy admin break out of the guardrail test sandbox and run code on the gateway.

- **Severity:** High: A working attack on a widely used AI product or ecosystem. A fix may exist. Patch or mitigate this week.
- **Category:** Vulnerability
- **Published by:** CISA
- **Disclosed:** 2026-11-18
- **CVE:** CVE-2026-40217
- **CVSS:** 7.5
- **Affects:** LiteLLM, litellm (PyPI)
- **Research by:** [Markus Vervier](https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm) (X41 D-Sec)
- **Primary source:** https://www.cisa.gov/news-events/alerts/2026/11/18/cisa-adds-four-known-exploited-vulnerabilities-catalog
- **Page:** https://theinjection.dev/items/cisa-kev-litellm-guardrail-sandbox-escape/

CISA added CVE-2026-40217, a sandbox escape in LiteLLM's custom-code guardrail endpoint, to its Known Exploited Vulnerabilities catalog on November 18, 2026. Federal civilian agencies have until December 2 to act.

## What happened

CISA listed CVE-2026-40217 in its Known Exploited Vulnerabilities catalog on November 18, 2026, in an alert covering four flaws, and says catalog additions are based on evidence of active exploitation. Markus Vervier of X41 D-Sec published the flaw on April 8, 2026 after an embargo expired, and BerriAI shipped its own advisory in May. The KEV entry sets a federal remediation deadline of December 2, 2026.

## How it works

The LiteLLM proxy exposes POST /guardrails/test_custom_code, which runs Python that a caller supplies inside a sandbox the project built by hand. Vervier's advisory describes bypassing its regex source filter by assembling blocked names at runtime and rewriting CPython bytecode to reach the unrestricted builtins. The result is arbitrary code execution in the proxy process, which runs as root in the default Docker image. BerriAI's fix replaces the hand-written sandbox with RestrictedPython.

## Who is affected

LiteLLM deployments on pip litellm from version 1.81.8 up to but not including 1.83.10 sit inside the GitHub advisory's affected range. Reaching the endpoint needs a proxy-admin credential in a default configuration, so the exposed operators are those whose master key is widely shared or whose management interface is reachable from an untrusted network.

## What to do

Upgrade litellm to 1.83.11 or later, the release the advisory's Patches section names. Until that lands, block POST /guardrails/test_custom_code at your reverse proxy or API gateway. X41 also advises keeping the management interface off untrusted networks, limiting who holds the master key, and running the container as a non-root user.

## Quick facts

- **Affected:** litellm (PyPI) 1.81.8 up to but not including 1.83.10
- **Fixed in:** 1.83.11 or later per the advisory's Patches section; its patched-version field says 1.83.10
- **Added to KEV:** 2026-11-18, alongside Synology DSM, Apache Axis and REDCap flaws
- **Deadline:** 2026-12-02 for Federal Civilian Executive Branch agencies, under BOD 26-04
- **Attack type:** Sandbox escape through CPython bytecode rewriting at /guardrails/test_custom_code
- **Prerequisite:** A proxy-admin credential in default configurations
- **Found by:** Markus Vervier, X41 D-Sec, advisory X41-2026-001 published 2026-04-08

## Questions

### Is my LiteLLM deployment affected by CVE-2026-40217?

LiteLLM installations running pip litellm from version 1.81.8 up to but not including 1.83.10 fall inside the GitHub advisory's affected range. Deployments already on 1.83.11 or later sit outside it. Reaching the vulnerable endpoint requires a proxy-admin credential in a default configuration, so operators who share that key widely or expose the management interface carry the most risk.

### Which LiteLLM version fixes the guardrail sandbox escape?

BerriAI's advisory lists 1.83.10 in its patched-version field, while the same advisory's Patches section tells operators to upgrade to 1.83.11 or later, which makes 1.83.11 the safer target. The fix swaps the hand-written sandbox for RestrictedPython. Operators who cannot upgrade at once can block POST /guardrails/test_custom_code at a reverse proxy or API gateway.

### Is CVE-2026-40217 actually being used in attacks?

CISA states that additions to the Known Exploited Vulnerabilities catalog rest on evidence of active exploitation, and added CVE-2026-40217 on November 18, 2026. Google Threat Intelligence Group's November 16 report names the same CVE in LLMjacking intrusions, describing a sandbox escape used to turn a LiteLLM Virtual Key into an admin credential. CISA records ransomware use as unknown.

### What does the KEV listing require federal agencies to do?

CISA set a remediation deadline of December 2, 2026 for CVE-2026-40217 under Binding Operational Directive 26-04. Agencies must apply the vendor's mitigations, or discontinue use of LiteLLM if no mitigation is available. CISA notes that BOD 26-04 binds only Federal Civilian Executive Branch agencies, and the catalog entry marks forensic triage as not required.

### How does this differ from the October LiteLLM package compromise?

Two separate LiteLLM problems reached defenders this autumn. CVE-2026-40217 is a flaw in LiteLLM's own guardrail test endpoint, reported by X41 D-Sec in April 2026 and now listed as exploited. The October 2026 event was a supply chain compromise in which malicious 1.107.0 wheels and container images carried a credential stealer. Patching one does not address the other.

## Sources

1. [CISA KEV Alert](https://www.cisa.gov/news-events/alerts/2026/11/18/cisa-adds-four-known-exploited-vulnerabilities-catalog)
2. [GitHub Advisory](https://github.com/advisories/GHSA-wxxx-gvqv-xp7p)
3. [X41 Advisory](https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm)
4. [KEV Catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog)
