# CVE-2026-40217: LiteLLM has a sandbox escape in custom-code guardrail

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Yes: in CISA KEV since 2026-11-18; federal due date 2026-12-02
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, login needed
- **CWE:** CWE-420
- **Aliases:** GHSA-wxxx-gvqv-xp7p, PYSEC-2026-2601
- **Published:** 2026-04-10T13:43:23.147Z
- **Modified:** 2026-11-19T17:18:57.120Z

## Who should check

- Projects that depend on PyPI package litellm (\>= 1.81.8, \< 1.83.10)
- Anyone running BerriAI LiteLLM bb0639701796218a3447160e55c0f1097446e4e6085df7dfd39f476d4143743f

## Description

LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test\_custom\_code URI.

## Affected and fixed versions

- PyPI `litellm`: affected \>= 1.81.8, \< 1.83.10; fixed 1.83.10 (osv)
- BerriAI LiteLLM: bb0639701796218a3447160e55c0f1097446e4e6085df7dfd39f476d4143743f (cvelist)

## Technologies

PyPI packages, Red Hat (all products)

## Mitigation

- Upgrade litellm to 1.83.10 or later.

## Timeline

- 2026-04-10: Published
- 2026-11-18: Added to CISA KEV (exploited in the wild)
- 2026-11-19: Last modified
- 2026-12-02: CISA remediation due date for US federal agencies

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-40217. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-40217.md
Affected: litellm >= 1.81.8, < 1.83.10
Fixed in: 1.83.10

Steps:
1. Search this machine and project for litellm (PyPI), BerriAI LiteLLM: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-40217 being exploited?

Yes. CISA lists CVE-2026-40217 in its Known Exploited Vulnerabilities catalog since 2026-11-18, which means attacks have been seen. Public exploit code or a proof of concept is available.

### How serious is CVE-2026-40217?

High: CVSS 8.8 (v3.1, scored by CNA). Remote, login needed.

### Which versions are affected by CVE-2026-40217?

litellm \>= 1.81.8, \< 1.83.10.

### Is there a fix for CVE-2026-40217?

Yes. Fixed in 1.83.10. Upgrade litellm to 1.83.10 or later.

### How do I check if I'm affected by CVE-2026-40217?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://access.redhat.com/errata/RHSA-2026:24866>
- vendor: <https://access.redhat.com/errata/RHSA-2026:30056>
- vendor: <https://github.com/BerriAI/litellm/security/advisories/GHSA-wxxx-gvqv-xp7p>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-40217>
- vendor: <https://github.com/advisories/GHSA-wxxx-gvqv-xp7p>
- exploit: <https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm/>
- other: <https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-40217>
- other: <https://access.redhat.com/security/cve/CVE-2026-40217>
- other: <https://bugzilla.redhat.com/show_bug.cgi?id=2457301>
- other: <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40217.json>
- other: <https://github.com/BerriAI/litellm>
- other: <https://github.com/BerriAI/litellm/releases/tag/v1.83.10-stable>
- other: <https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm>
- other: <https://pypi.org/project/litellm>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-40217>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-wxxx-gvqv-xp7p> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-2601> (license: <https://creativecommons.org/licenses/by/4.0/>)
- CISA KEV: CISA Known Exploited Vulnerabilities Catalog <https://www.cisa.gov/known-exploited-vulnerabilities-catalog>

HTML: <https://flawdb.com/CVE-2026-40217> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-40217>
