{"id":"CVE-2026-40217","aliases":["PYSEC-2026-2601"],"url":"https://o3.security/vulnerability/CVE-2026-40217","summary":"LiteLLM has a sandbox escape in custom-code guardrail","details":"### Impact\n\nThe `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.\n\n**Reaching the endpoint requires a proxy-admin credential** in default configurations.\n\n### Patches\n\nFixed in **`1.83.11`**. The hand-rolled sandbox has been replaced with `RestrictedPython`. Upgrade to `1.83.11` or later.\n\n### Workarounds\n\nIf upgrading is not immediately possible, block `POST /guardrails/test_custom_code` at your reverse proxy or API gateway.\n\n### References\n\n- Patched release: [`v1.83.10-stable`](https://github.com/BerriAI/litellm/releases/tag/v1.83.10-stable)","published":"2026-05-11T16:17:23Z","modified":"2026-09-10T03:51:07.231161323Z","cvss":{"score":8.8,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},"epss":{"score":0.06496,"percentile":0.93227,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"litellm","fixedVersion":"1.83.10"}],"fix":null,"references":[{"type":"WEB","url":"https://github.com/BerriAI/litellm/security/advisories/GHSA-wxxx-gvqv-xp7p"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40217"},{"type":"PACKAGE","url":"https://github.com/BerriAI/litellm"},{"type":"WEB","url":"https://github.com/BerriAI/litellm/releases/tag/v1.83.10-stable"},{"type":"WEB","url":"https://www.x41-dsec.de/lab/advisories/x41-2026-001-litellm"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-09-10T03:51:07.231161323Z"}}