Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-40217

LiteLLM has a sandbox escape in custom-code guardrail
Back to all
CVE

CVE-2026-40217

LiteLLM has a sandbox escape in custom-code guardrail

Impact

The POST /guardrails/testcustomcode endpoint runs user-supplied Python inside a hand-rolled sandbox. The sandbox can be escaped using bytecode-level techniques, allowing arbitrary code execution in the proxy process — which runs as root in the default Docker image.

Reaching the endpoint requires a proxy-admin credential in default configurations.

Patches

Fixed in 1.83.11. The hand-rolled sandbox has been replaced with RestrictedPython. Upgrade to 1.83.11 or later.

Workarounds

If upgrading is not immediately possible, block POST /guardrails/testcustomcode at your reverse proxy or API gateway.

References

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
8.8
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
C
H
U
0
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
C
H
U
8.8
-
3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Related Resources

No items found.

References

https://github.com/BerriAI/litellm/security/advisories/GHSA-wxxx-gvqv-xp7p, https://nvd.nist.gov/vuln/detail/CVE-2026-40217, https://github.com/BerriAI/litellm, https://github.com/BerriAI/litellm/releases/tag/v1.83.10-stable, https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm

Severity

8.8

CVSS Score
0
10

Basic Information

Base CVSS
8.8
EPSS Probability
0.1702%
EPSS Percentile
0.97134%
Introduced Version
1.81.8,1.81.16,0
Fix Available
1.83.10,1.83.9,3.2.2-r7

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading