BerriAI LiteLLM proxy · CVE-2026-40217
LiteLLM RCE
Patch nowIn CISA KEV, due 2 Dec. Public PoC, needs admin key.
LiteLLM's proxy has an endpoint for testing custom guardrail code, and its home-made sandbox can be escaped to run any command, as root in the default Docker image. It needs a proxy-admin key, but attackers have been guessing default keys, and two other bugs let ordinary users become admin on older versions.
How scary is it?
Are you affected? only if all are true
1LiteLLM 1.81.8 – 1.83.10command
GitHub's advisory lists >= 1.81.8, < 1.83.10 as affected, but its text says the fix is in 1.83.11, so count 1.83.10 as affected to be safe. Only the proxy server is at risk, not plain use of the Python SDK. In Docker, image tags don't reliably match versions (main-latest tells you nothing), so check the pip version inside the container.3,5
pip show litellm2Management API is reachablecommand
The attacker can reach the proxy's management API, including POST /guardrails/test_custom_code. Keep it off untrusted networks.3,4
docker ps --format '{{.Names}} {{.Image}}' | grep -i litellm3Attacker has an admin key
The default config requires a proxy-admin credential (the master key). These also count: a weak key like sk-1234; no master key at all (callers are treated as admin); any user account below 1.83.14 (CVE-2026-47101/47102) or on 1.91.0 up to the CVE-2026-114612 fix; Enterprise-licensed proxies below 1.106.5, which can leak the master key to anyone; and proxies below 1.106.9 with an Azure model but no Azure API key set, where any logged-in user can read the master key.3,5,6,7,11,12,13,16
What to do
1Upgrade to the newest on your line
1.83.11 fixed this sandbox escape, but later releases had their own admin-takeover bugs. Use at least 1.106.9, 1.108.6 or 1.109.1 (listed below). These also cover the older LiteLLM KEV entries CVE-2026-42208 and CVE-2026-42271 (fixed 1.83.7) and CVE-2026-59822 (fixed 1.84.0).3,11,12,16,14,15,10
Latest safe versions checked 20 Nov
2Until then: block the endpoint
Block POST /guardrails/test_custom_code at your reverse proxy or API gateway. Keep the admin port off the internet. If you use Azure models, also block the fields tenant_id, client_id, client_secret, azure_username, azure_password and azure_scope in request bodies.3,4,16
3Rotate a weak or old master key
Attackers sprayed default-style keys at this endpoint. If yours is guessable or was exposed, replace it. The escape exposes provider and cloud keys stored in the proxy, so rotate those too.5
4Run the container as non-root
The default image runs as root, so a sandbox escape gets root. LiteLLM also ships a non-root image.3,5
This page shows you how to check. It can't tell you you're safe.
Sources (17) and changelog
- CISA KEV: CVE-2026-40217 added 18 Nov, due 2 Dec 18 Nov
- CISA alert: four KEV additions incl. LiteLLM 18 Nov
- LiteLLM GHSA-wxxx-gvqv-xp7p: versions, auth, workaround 7 May
- X41 D-Sec: original advisory and PoC 8 Apr
- Zenity Labs: in-the-wild attempts, key spraying 30 Jun
- GHSA-qrc4-49gv-mv9m: CVE-2026-47101, fixed 1.83.14 21 May
- GHSA-wpfp-gwwc-vwq6: CVE-2026-47102, fixed 1.83.10 21 May
- LiteLLM v1.83.10-stable release: Docker tag format 27 Apr
- NVD: CVE-2026-40217
- LiteLLM GHSA-7488-6r32-c95q: CVE-2026-59822, fixed 1.84.0 30 Jun
- LiteLLM GHSA-7hp6: CVE-2026-114612, user to admin on 1.91.0+
- LiteLLM GHSA-w4c7: master key leak, fixed 1.106.5
- LiteLLM GHSA-72m8: no master key means admin
- LiteLLM GHSA-r75f: CVE-2026-42208, fixed 1.83.7
- LiteLLM GHSA-v4p8: CVE-2026-42271, fixed 1.83.7
- LiteLLM GHSA-2rwg: master key leak via Azure models, fixed 1.106.9 12 Nov
- PyPI: LiteLLM release history
- New advisory GHSA-2rwg (master key leak via Azure models): minimum raised to 1.106.9 / 1.108.6 / 1.109.1. Safe versions added.
- Review: upgrade floor raised to 1.106.5 after newer admin-takeover advisories; Docker tag caveat.
- Added to CISA KEV, due 2 Dec.
- Zenity reported in-the-wild exploitation attempts.
- Published.