LiteLLM has a sandbox escape in custom-code guardrail
Impact
The POST /guardrails/test_custom_code 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/test_custom_code at your reverse proxy or API gateway.
References
- Patched release:
v1.83.10-stable
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | litellm | >= 1.81.8, < 1.83.10 | 1.83.10 |
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
- https://pypi.org/project/litellm
- https://github.com/advisories/GHSA-wxxx-gvqv-xp7p
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-420, CWE-913- Platform
- Python (PyPI)
- Package
litellm- Disclosed
- 11.05.2026
- Updated
- 11.10.2026 15:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-2601 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-wxxx-gvqv-xp7p - CC BY 4.0
Vulnerability history: litellm
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 42
- First → latest
- 04.2024 09.2026
- Without a fix
- 14
- Exploited in attacks
- 3
Severity breakdown
- Critical 7
- High 17
- Medium 8
- Low 9
- Unrated 1
Disclosures per year
- 2024: 8
- 2025: 6
- 2026: 28
-
LiteLLM has a sandbox escape in custom-code guardrail this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.