この記事は英語で公開されています。
By UNST33R
LiteLLM guardrails RCE lands on CISA's exploited list: patch deadline December 2
CISA added CVE-2026-40217 to the Known Exploited Vulnerabilities catalog on November 18, 2026. The bug is remote code execution in LiteLLM's custom-code guardrail testing endpoint, reached through bytecode-rewrite sandbox escape, running as root in the default Docker image. Version exposure, the auth chain that makes it remote, the workaround, and what an authorized assessment should do with it before the December 2 deadline.
On November 18, 2026, CISA added CVE-2026-40217 to the Known Exploited Vulnerabilities catalog, with a federal remediation deadline of December 2, 2026. The affected product is LiteLLM, the self-hosted LLM gateway that a large share of AI engineering teams put in front of their model APIs. The vulnerability is arbitrary code execution in the proxy process, reached through the POST /guardrails/test_custom_code endpoint. If you run LiteLLM anywhere in your stack, this is a two-week clock, and this post covers what the bug actually is, who is realistically exposed, and what to do about it.
The vulnerability in one table
| Field | Value | Source |
|---|---|---|
| CVE | CVE-2026-40217, CWE-420 (Unprotected Alternate Channel) | NVD, published April 10, 2026 |
| Advisory | GHSA-wxxx-gvqv-xp7p, "LiteLLM has a sandbox escape in custom-code guardrail", CVSS 8.8 High | GitHub advisory, published May 11, 2026 |
| Vulnerable range | litellm >= 1.81.8, < 1.83.10 on PyPI | Advisory metadata |
| Fix | Advisory metadata lists 1.83.10 as first patched; advisory text says upgrade to 1.83.11 or later, which replaced the sandbox with RestrictedPython | v1.83.10-stable release |
| Attack surface | POST /guardrails/test_custom_code runs user-supplied Python inside a hand-rolled sandbox; bytecode-level techniques escape it | Advisory impact section |
| Privilege | The proxy process, which runs as root in the default Docker image | Advisory impact section |
| Preconditions | A proxy-admin credential in default configurations | Advisory impact section |
| KEV | Added November 18, 2026; due December 2, 2026; ransomware use listed as Unknown | KEV catalog |
The endpoint exists for a reasonable product purpose. LiteLLM's guardrails subsystem lets operators attach content filters to routes, and custom-code guardrails are Python callables that implement apply_guardrail. The /guardrails/test_custom_code endpoint lets an administrator trial a guardrail snippet against sample traffic before promoting it into config. The failure was in the execution substrate: a sandbox written by hand, defending against an interpreter whose own bytecode is an attack primitive.
What bytecode rewriting means here
Most hand-rolled Python sandboxes work by intercepting the dangerous builtins: delete eval, delete exec, delete __import__, filter attribute names. That approach lost the arms race years ago. Python compiles source to bytecode before execution, and bytecode-level techniques construct code objects or reach frame internals directly, assembling calls to machinery the builtin-removal pass never touched. The advisory's phrase is "bytecode rewriting," and the class of escape it names is why the maintainers replaced the hand-rolled sandbox with RestrictedPython, a library whose entire reason to exist is policy-checked compilation and execution of untrusted Python.
Two details make the bug worse than a generic RCE. First, the default Docker image runs the proxy as root, so escaped code starts with uid 0 inside the container. Second, the gateway holds every credential the deployment uses: upstream provider keys, database connections, virtual keys, and config secrets. A process-level escape lands directly in the key store. Our backdoor analysis of the trojanized 1.107.0 release documented why that data is the prize; the payload's first query there was the credentials table.
Who is actually exposed
The current release train is far past the fix: PyPI lists 1.110.2 as latest at our November 22 check. Nobody running current versions carries the vulnerable code. Exposure concentrates in two populations.
The first is pinned deployments stuck between 1.81.8 and 1.83.9. Enterprises pin gateway versions for stability, review cycles, or air-gap change control, and a May patch on an April CVE is old enough to have fallen out of patch radar without being old enough to have been replaced. The second is the admin-credential precondition, which sounds like a mitigation and in practice is the weak half. LiteLLM's history this year shows why:
| 2026 event | What it proved | Reference |
|---|---|---|
| September: authentication bypass to cloud compromise | Weak master-key setups convert a single gateway bug into cloud credential theft | Wiz Research |
| October: exposed instances handing over admin control | Large numbers of proxies are reachable and effectively unauthenticated | Check Point Research |
| October 21: trojanized 1.107.0 on PyPI | The package itself is supply-chain attack surface | Our analysis |
Chain any of those conditions with CVE-2026-40217 and the "requires admin" precondition stops being a barrier. An exposed proxy with a guessable or shared master key gives an attacker the admin role, and the guardrails endpoint then converts that role into root code execution. This is the admin-plane pattern we traced in the Kong AI Gateway model-name SQL injection: the endpoints designed for operators to test and configure the gateway are its sharpest attack surface. Our 2026 LLM-stack CVE census counted 387 advisories across twelve core packages through November 15; the governance tier keeps producing this shape of bug.
The operator playbook before December 2
Order matters here, because the workaround and the detection both inform whether you need to treat the host as compromised.
- Establish the version.
pip index versions litellmor check the image tag. Anything below 1.83.10 on a proxy that ever faced a network is in scope. - Apply the vendor workaround if you cannot upgrade today. The advisory's stated mitigation is blocking
POST /guardrails/test_custom_codeat the reverse proxy or API gateway. That kills the specific URI while leaving the data plane serving. - Hunt the logs. Grep proxy and reverse-proxy access logs for
guardrails/test_custom_code. Any hit with a 2xx status on a vulnerable version is code execution evidence, and the response follows from that: rotate every credential the proxy can read, treat the container and its host as suspect, and pull the database for post-hit key creation. - Upgrade to 1.83.11 or later, then re-run the audit below.
- Separate the planes so the next admin-plane bug stays contained. Our gateway hardening guide covers the config pattern: per-engagement virtual keys with budgets, the real provider key only in the proxy environment, and admin access restricted to a control network. An operator who followed that pattern still loses the proxy process to a bug like this one, and loses far less else.
For teams that must justify the work internally, the KEV entry's required action references BOD 26-04 prioritization guidance, which is the compliance hammer for federal agencies and a useful severity anchor for everyone else.
What an authorized assessment does with this
Two uses, one defensive and one offensive, both inside scope.
Defensively, the checklist above is the incident runbook your client with a LiteLLM deployment needs validated this week: version inventory across every proxy instance, exposure check on the admin listener, log review for the endpoint, and credential rotation evidence. That is a bounded, deliverable engagement slice.
Offensively, within a signed scope that includes the gateway, the bug is a legitimate demonstration path with a clean narrative: weak admin authentication to guardrails endpoint to container root to credential store. The demonstration lands harder when paired with what the client's own logs did and did not record about the request, because detection gaps are the finding that outlives the patch. Bulk work of this kind, sweeping version strings and endpoint reachability across a large authorized estate, is high-volume and tolerance-free, which is where the cheap tier wins: unst33r-deepseek at $0.15 per million input tokens prices a ten-million-token sweep corpus at $1.50, with report drafting and exploit-chain narrative left to unst33r-pro. The tier selection guide covers the split in detail.
One boundary note: KEV listing means observed exploitation in the wild. Testing this against systems you do not own or operate is a crime in most jurisdictions and outside our acceptable-use policy. The catalog entry is a patching signal, and a scoping input for assessments that were already authorized.
Timeline
| Date | Event |
|---|---|
| April 10, 2026 | NVD publishes CVE-2026-40217 |
| May 11, 2026 | GHSA-wxxx-gvqv-xp7p published, CVSS 8.8, RestrictedPython fix documented |
| November 18, 2026 | CISA adds the CVE to KEV, implying observed exploitation |
| December 2, 2026 | Federal remediation deadline |
An April disclosure that reaches the exploited list seven months later usually means one thing: the installed base never moved. Gateway dependencies get pinned, forgotten, and rediscovered by adversaries scanning for the exact endpoint string. If your estate has a LiteLLM instance in it, this week is when the version check costs nothing and the alternative costs a lot more.