What matters now
Current position: High priority for any internet-reachable or weakly protected self-hosted proxy. Exploitation needs a proxy admin credential, but the code that follows runs as the proxy user (root in the default Docker image). Published severity scores range from 5.9 (CVSS v4, GitHub advisory) to 8.8.
Affected versions: LiteLLM 1.81.8 up to but not including 1.83.10 per the GitHub advisory; the advisory text names 1.83.11 as the fix, so treat 1.83.11 or later as the safe target.
Observed exploitation: Listed in CISA's KEV catalogue on 18 November 2026 (federal due date 2 December 2026; known ransomware use listed as Unknown). Zenity Labs independently reported honeypot attempts against the endpoint between 15 April and 24 May 2026. No affected organisations have been publicly named in the sources reviewed.
Recommended next action: Upgrade the LiteLLM proxy to 1.83.11 or later. Until then, block POST /guardrails/test_custom_code at the reverse proxy, replace any default or guessable master key, restrict network access to the admin interface, search logs for requests to the endpoint and rotate credentials if any succeeded.
Identifiers: CVE-2026-40217
If you run a self-hosted LiteLLM proxy, check the version today. CVE-2026-40217 affects versions from 1.81.8 up to but not including 1.83.10, and the advisory text names 1.83.11 as the fix, so upgrade to 1.83.11 or later. An attacker needs a valid proxy admin credential (normally the master key) to reach the vulnerable endpoint, POST /guardrails/test_custom_code, but CISA added the flaw to its Known Exploited Vulnerabilities catalogue on 18 November 2026 and honeypot researchers have seen weak and default master keys being tried. If you cannot upgrade today, block that path at your reverse proxy, make sure your master key is not a default, and search your logs for any request to the endpoint.
What has happened and what it means for you
On 18 November 2026 CISA added CVE-2026-40217, titled "BerriAI LiteLLM Unprotected Alternate Channel Vulnerability", to its Known Exploited Vulnerabilities (KEV) catalogue. CISA's entry describes remote attackers executing arbitrary code through bytecode rewriting at the /guardrails/test_custom_code URI. The catalogue lists federal agencies' remediation deadline as 2 December 2026, and records known ransomware use as "Unknown". Being on the list means CISA holds evidence of exploitation. It does not tell you who was hit, and we are not aware of any public naming of affected organisations.
LiteLLM is an open-source gateway that sits in front of many AI model providers. The proxy holds provider API keys and often cloud credentials in its environment. The flaw is in a guardrail testing endpoint that runs submitted Python inside a home-made sandbox. The sandbox relied on blocking certain keywords, and that can be got around. Code that escapes runs with the privileges of the proxy process, and in the default Docker image that is root.
This only matters if you self-host the LiteLLM proxy server. Using the LiteLLM Python library as a client, without running the proxy, is not the exposed component described in the advisory.
Who is affected and what an attacker needs
The GitHub security advisory (GHSA-wxxx-gvqv-xp7p) lists affected versions as 1.81.8 up to but not including 1.83.10. The same advisory shows 1.83.10 in its patched-versions field but names 1.83.11 in its description of the fix. We can't reconcile that from the published pages, so treat 1.83.11 or later as the safe target. Zenity Labs, which has published its own analysis, describes 1.83.10 as the fix. Moving to 1.83.11 or later satisfies both readings.
An attacker must authenticate to the proxy with an admin-level credential, which in a default configuration means the master key. That is why published severity scores differ so much: the GitHub advisory rates it Moderate (CVSS v4 5.9, privileges required: high), while X41 D-Sec, who reported it, scored it 8.7 and other trackers cite 8.8 on CVSS 3.1. In practice the question is how well your master key is protected. A proxy exposed to the internet with a guessable key is a very different case from one on a private network with a long random key.
Zenity Labs reported its honeypot sensors recorded 569 POST requests to the endpoint between 15 April and 24 May 2026. Some requests were harmless marker tests. Later ones were crafted attempts to read environment variables and run operating-system commands, with attackers cycling through default-style keys such as sk-1234. That is independent evidence of real attempts, though it describes honeypots, not confirmed compromises of production systems.
- Affected: self-hosted LiteLLM proxy, versions 1.81.8 to before 1.83.10 (and, to be safe, treat 1.83.10 itself as a version to move off).
- Needed to exploit: a valid proxy admin credential, normally the master key, plus network access to the proxy.
- Impact: arbitrary code execution as the proxy process user, which is root in the default Docker image, and exposure of everything in that environment.
Check your version and exposure
Start with read-only checks. Run these where LiteLLM is installed, or inside the container, with an account that can read the environment. Nothing here changes the system.
- For a pip install, print the installed version. Anything between 1.81.8 and 1.83.10 is affected, and 1.83.10 itself should be moved on from.
pip show litellm - For a Docker deployment, run the same check inside the running container. Replace YOUR_CONTAINER_NAME with the name shown by docker ps. If you deploy from a main-latest tag or an old image digest, assume you are behind until the version proves otherwise.
docker exec YOUR_CONTAINER_NAME pip show litellm - Work out who can reach the proxy. If its admin routes are reachable from the internet, or from a wide internal network, prioritise this above other maintenance.
Upgrade to a fixed release
The fix replaces the keyword filter with a RestrictedPython-based sandbox. Upgrading restarts the proxy, so API calls through it will fail briefly. Pick a quiet period if applications depend on it. Keep your configuration file and database backed up as you normally would before a version change, since a release jump of this size may include other changes. Read the release notes for the version you choose.
- Upgrade the package to 1.83.11 or later. The command below suits a pip-managed proxy installation; use your own deployment method if you manage it with Compose, Kubernetes or a pipeline.
pip install --upgrade "litellm[proxy]>=1.83.11" - For container deployments, change the image reference to a pinned release at or above 1.83.11, not main-latest, then redeploy. Check the BerriAI release page on GitHub for the exact tag names.
- Restart the proxy, then rerun the version check from the previous section. It should report 1.83.11 or later. Send a normal test request through the proxy to confirm your applications still work.
If you cannot upgrade today: block the endpoint
Most teams never call the guardrail tester in production, so denying that one path is a reasonable stopgap. Do it at the reverse proxy or API gateway in front of LiteLLM, not inside LiteLLM. The nginx example below returns 403 for the path and anything beneath it. Adapt it to your own gateway, and check your configuration syntax before reloading so you don't take the whole site down. This is a stopgap, not a fix: the vulnerable code stays in place.
Also tighten the two things the attack relies on. Make sure the master key is a long random value, not a default or a placeholder such as sk-1234. Restrict who can reach the proxy's admin interface to trusted networks.
location ^~ /guardrails/test_custom_code {
return 403;
}Look for signs it has already been used
Exploitation leaves a request in your access logs, so search for it. The command below reads the nginx access logs, compressed rotations included, and prints only matching lines. Adjust the path for your own reverse proxy or gateway. If LiteLLM sits directly on the internet with no logging in front, check the container logs instead.
Any request to the path from an address that is not you or your administrators deserves attention. A 200 response is more worrying than a 401 or 403, because it suggests the credential was accepted. Also look for unexpected use of the master key from unfamiliar addresses, unexpected outbound connections from the proxy host, and new files or processes in the container. Zenity published source addresses seen in its honeypot data, but one of them is written two different ways in the same article, so verify any address against the original before adding it to a blocklist.
zgrep -h "test_custom_code" /var/log/nginx/access.log*If you find a request that succeeded
Treat the proxy's environment as exposed. That generally means every provider API key, cloud credential and database password the process could read, as well as the master key. The attempts Zenity observed specifically targeted environment variables and command execution.
Rotate the credentials the proxy holds, starting with the master key and the upstream provider keys, then review billing and usage on those providers for activity you do not recognise. Rebuild the container from a patched image rather than cleaning it in place, as code execution as root means you cannot be sure what was changed. Rotating the master key is separate from LiteLLM's salt key, which protects stored credentials. Follow LiteLLM's own documentation and avoid changing the salt key unless you are certain, as stored values may become unreadable.
If the proxy host has wider network access, such as into cloud accounts or internal databases, bring in whoever handles incident response. That is the point to stop following a checklist and call for help.
Run the proxy as a non-root user
LiteLLM ships a non-root image variant, and several sources recommend it. It doesn't prevent the escape, but it limits what the attacker gets afterwards: root in a container is a far better starting position than an unprivileged user. Move to it when you next redeploy, after the patch is in. It is worth doing, though it does not replace the upgrade.
Update history
We’ll keep this page updated as new information becomes available. Check back for the latest developments.
Initial update, 19 November 2026: CISA added CVE-2026-40217 to the KEV catalogue on 18 November 2026 with a federal remediation date of 2 December 2026. Upgrade to LiteLLM 1.83.11 or later and block the guardrail test endpoint if you cannot patch immediately. Update source
Technical terms explained
- KEV
- CISA's Known Exploited Vulnerabilities catalogue, a list of flaws for which CISA has evidence of exploitation in the wild. Inclusion sets remediation deadlines for US federal agencies and is a useful priority signal for everyone else.
- master key
- The admin credential for a LiteLLM proxy, set by the operator. It grants administrative control, including access to the vulnerable guardrail testing endpoint.
- RestrictedPython
- A Python library that compiles code under restrictions. LiteLLM's advisory says the fixed version uses it in place of the previous keyword deny-list.
- reverse proxy
- A web server or gateway, such as nginx, that receives requests on behalf of an application and passes them on. It is a convenient place to block a specific URL path.
- sandbox
- A restricted environment intended to stop submitted code from touching the system around it. A sandbox escape means that restriction can be bypassed.
Sources and further reading
- CISA - Known Exploited Vulnerabilities Catalog
- CISA - CISA Adds Four Known Exploited Vulnerabilities to Catalog (18 November 2026)
- GitHub Security Advisory GHSA-wxxx-gvqv-xp7p - LiteLLM custom-code guardrail sandbox escape
- X41 D-Sec advisory X41-2026-001 - Guardrail Sandbox Escape in LiteLLM
- Zenity Labs - Threat actors are trying to use LiteLLM's guardrail tester to run code as root