{"slug": "litellm-s-guardrail-sandbox-escape-is-now-actively-exploited-what-to-check-today", "title": "LiteLLM's Guardrail Sandbox Escape Is Now Actively Exploited: What to Check Today", "summary": "CISA added CVE-2026-40217, a sandbox escape in the open-source LiteLLM proxy, to its Known Exploited Vulnerabilities catalog on November 18, 2026, giving US federal agencies until December 2 to apply mitigations. The flaw lets the /guardrails/test_custom_code endpoint break out of a home-made Python sandbox to achieve arbitrary code execution in the proxy process, which typically holds every provider API key and runs as root in the default Docker image; Zenity Labs honeypots logged 569 exploit attempts against the endpoint between April and May 2026. The bug affects LiteLLM 1.81.8 through 1.83.9, with a full fix set for related privilege-escalation flaws in v1.83.14-stable and an MCP auth bypass fixed in v1.84.0.", "body_md": "On November 18, 2026, CISA added [CVE-2026-40217](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2026-40217) to its Known Exploited Vulnerabilities catalog. The bug is in LiteLLM, the open-source proxy many AI products put in front of OpenAI, Anthropic, Bedrock and Gemini so they can switch models, track spend and hand out virtual keys. CISA lists it because there is evidence of exploitation, not because it is new: the fix shipped in April.\n\nIf your team self-hosts the LiteLLM proxy, this is a short check. The proxy usually holds every provider API key you own, so code execution on it is a key-theft problem, not just a server problem.\n\nLiteLLM has an endpoint, `POST /guardrails/test_custom_code`, that runs Python you submit so you can try out a custom guardrail. It ran that code in a home-made sandbox. According to the [GitHub advisory GHSA-wxxx-gvqv-xp7p](https://github.com/advisories/GHSA-wxxx-gvqv-xp7p), the sandbox \"can be escaped using bytecode-level techniques\", which gives arbitrary code execution inside the proxy process. The advisory notes the proxy runs as root in the default Docker image.\n\n**Verified, from the advisory:**\n\n`litellm` 1.81.8 up to but not including 1.83.10.`POST /guardrails/test_custom_code` at your reverse proxy or gateway.\nCISA's entry gives US federal agencies until December 2, 2026 to apply mitigations. That deadline does not bind private companies, but it is a useful signal of priority.\n\nA bug that needs an admin key sounds low risk. Two things change that.\n\n**Attackers guess admin keys.** Zenity Labs [reported in June](https://labs.zenity.io/p/threat-actors-are-trying-to-use-litellm-s-guardrail-tester-to-run-code-as-root) that its honeypots logged 569 POST requests to this exact endpoint between April 15 and May 24, 2026. The requests cycled through 47 guessed master keys such as `sk-1234`, `sk-admin` and `sk-changeme`, then tried payloads that dumped environment variables and ran shell commands. If your master key was ever left at an example value, assume someone has tried it.\n\n**It chains with other LiteLLM bugs.** Obsidian Security [described a chain](https://obsidiansecurity.com/blog/litellm-privilege-escalation-rce) in which a normal `internal_user` key can raise itself to `proxy_admin` (CVE-2026-47101 and CVE-2026-47102) and then use this sandbox escape. Their write-up says the complete fix set for all three is in v1.83.14-stable. Separately, Wiz [reported an MCP authentication bypass](https://www.wiz.io/blog/off-guard-breaking-litellm-from-authentication-bypass-to-cloud-compromise), CVE-2026-59822, fixed in v1.84.0, which CISA added to the same catalog on September 2.\n\nSo the real question is not only \"is our admin key secret\" but \"which version are we on, and who can reach the proxy\".\n\n`pip show litellm` in any Python service. Staging and \"temporary\" demo proxies count.`POST /guardrails` unless you actually manage guardrails through them.`LITELLM_MASTER_KEY` and confirm no example value survives in any environment.`/guardrails/test_custom_code` and `/guardrails` from addresses you do not recognise, and for bursts of 401s with different bearer values (key guessing).`os.environ`, `subprocess`, `gi_code`, `f_builtins`, or names like `__globals__` assembled from string fragments.`litellm_settings.callbacks` in `config.yaml`. Obsidian notes that callbacks do not appear in the admin UI. Remove anything you did not add.`proxy_admin` and confirm each one.\nIf any of these turn up something odd, rotate every provider key, database password and MCP token the proxy could read, then rebuild the container from a clean image rather than cleaning it in place.\n\nIf you run a LiteLLM proxy, steps 1 to 5 above fit in an afternoon and tell you whether this was ever exposed. If the review shows one shared gateway holding every provider key with a public admin page, that is an architecture question about how your AI features reach models, and the [AI SaaS development](https://somanathkhadanga.com/services/ai-saas-development) service covers it. Bring your LiteLLM version, how the proxy is deployed, and who currently holds admin access.\n\n*Originally published at [somanathkhadanga.com](https://somanathkhadanga.com/blog/litellm-cve-2026-40217-exploited-guardrail-rce).*", "url": "https://wpnews.pro/news/litellm-s-guardrail-sandbox-escape-is-now-actively-exploited-what-to-check-today", "canonical_source": "https://dev.to/somnath_khadanga_2e5c2364/litellms-guardrail-sandbox-escape-is-now-actively-exploited-what-to-check-today-4kma", "published_at": "2026-12-02 05:35:38+00:00", "updated_at": "2026-12-02 05:43:32.648655+00:00", "lang": "en", "topics": ["ai-safety", "ai-infrastructure", "ai-agents", "ai-tools"], "entities": ["LiteLLM", "CISA", "Zenity Labs", "Obsidian Security", "Wiz", "CVE-2026-40217", "CVE-2026-47101", "CVE-2026-59822"], "also_reported_by": [], "takeaway": null, "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/litellm-s-guardrail-sandbox-escape-is-now-actively-exploited-what-to-check-today", "markdown": "https://wpnews.pro/news/litellm-s-guardrail-sandbox-escape-is-now-actively-exploited-what-to-check-today.md", "text": "https://wpnews.pro/news/litellm-s-guardrail-sandbox-escape-is-now-actively-exploited-what-to-check-today.txt", "jsonld": "https://wpnews.pro/news/litellm-s-guardrail-sandbox-escape-is-now-actively-exploited-what-to-check-today.jsonld"}}