LiteLLM is a widely used proxy that puts one OpenAI-style API in front of many model providers, and it runs as a Python service, usually in a container, on Linux. Its POST /guardrails/test_custom_code endpoint ran user-supplied Python in a sandbox written by hand, and that sandbox could be escaped using bytecode-level tricks to run code in the proxy process, which is root in the default Docker image. Reaching the endpoint needs the proxy admin credential (the master key), so this is an authenticated flaw, but it is on CISA’s exploited-vulnerabilities list. If you run LiteLLM in the affected range, upgrade to the 1.83.10 release line and keep the endpoint off the public network. LiteLLM is not on our Linux-server allow-list, but Red Hat tracks it in its AI products, so this is a reference draft; the checks and the fix are below.
CVE-2026-40217 at a glance.
| Component | the /guardrails/test_custom_code endpoint of the LiteLLM proxy (pip package litellm), typically run from ghcr.io/berriai/litellm as root. Not packaged by Debian, Ubuntu or a community distro; it is a PyPI/container project, which is why the tracker rule, not the allow-list, brought it in |
| Affected versions | 1.81.8 up to but not including 1.83.10 (NVD and the GitHub advisory). The X41 researcher advisory reports it against the main-latest image before a fix existed |
| Fixed in | the 1.83.10 release line; the GitHub advisory’s package data says >= 1.83.10 while its prose says 1.83.11, so pin to 1.83.11 or the latest stable to be safe. Red Hat ships the fix for OpenShift AI in 3.3.4 (RHSA errata in the NVD references) |
| Severity | CVSS 3.1 8.8 High from NVD and Red Hat (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H); the X41 advisory scores CVSS 4.0 8.7, and the GitHub advisory a lower 5.9 with PR:H. Red Hat rates it Important. CWE-94 (NVD and Red Hat); the GitHub advisory labels it CWE-913, NVD also lists CWE-420 |
| Exploited in the wild | Yes. Added to CISA’s Known Exploited Vulnerabilities catalogue on 18 November 2026; federal remediation due 2 December 2026. EPSS 0.206 (98.1th percentile) on 28 November 2026 |
| Who is exposed | any LiteLLM proxy in the affected range whose /guardrails/test_custom_code endpoint can be reached with the master key. Exploitation is authenticated and needs admin/master-key access, so an internet-exposed proxy with a known or leaked master key is the real risk. The default container runs as root, so a successful escape is root in the container. Not affected: 1.83.10/1.83.11 and later |
| Published | researcher advisory 8 April 2026, CVE record 10 April 2026; KEV listing 18 November 2026. This page built 29 November 2026 |
What it is
The endpoint exists to let an administrator test a custom guardrail: you post Python source and a test input, and the proxy runs the code and shows you what it does. To keep that from being arbitrary code execution, LiteLLM wrapped it in a sandbox of its own making that filtered the source text and tried to restrict what the code could reach. The X41 D-Sec advisory of 8 April 2026 describes how the filter, being a check on source text, was escaped with bytecode-level manipulation to recover the blocked built-ins and reach os.popen, and their proof of concept returned uid=0(root) in the default Docker deployment. The GitHub advisory records the fix as replacing the hand-rolled sandbox with RestrictedPython, which is the right direction: a text filter in front of a language as reflective as Python is very hard to make sound.
The one mitigating fact, consistent across the sources, is that the endpoint requires authentication: reaching it needs the LiteLLM master key (the proxy admin credential), which is why NVD and Red Hat score it with privileges required and Red Hat holds it at Important rather than Critical. That is also why the sources disagree on the exact number: X41’s 8.7 assumes a low-privilege reach, the GitHub advisory’s 5.9 assumes high privilege, and NVD and Red Hat land at 8.8. For an operator the practical reading is the same whichever number you prefer: a proxy whose master key is strong and whose admin surface is not on the public internet is in much better shape than one that fronts the API and the admin routes together. LiteLLM is not on our allow-list of Linux-server software; it is here because Red Hat tracks it in Red Hat AI and OpenShift AI and a distribution tracking it is our rule for inclusion, so we are marking this a draft for reference.
Who is affected on Linux
LiteLLM comes from PyPI or a container image, not a distribution package, so the deployed version is what matters. The distribution rows below are what the trackers showed on 29 November 2026.
| Distribution | Status | Fixed package |
|---|---|---|
| Ubuntu | Not applicable (“Does not apply to software found in Ubuntu”) | — |
| Debian | NOT-FOR-US: LiteLLM | — |
| Red Hat (AI products) | Affected, Important; OpenShift AI fixed in 3.3.4 per the NVD reference data | OpenShift AI 3.3.4; see the Red Hat page for AAP and Lightspeed |
| Fedora, openSUSE, Arch, Alpine | Not packaged | — |
PyPI litellm / ghcr.io/berriai/litellm | Affected 1.81.8 to before 1.83.10 | LiteLLM 1.83.11 or later |
How to check
Two questions: which LiteLLM version is running, and can the admin endpoint be reached from somewhere it should not be. The first is a version string; the second is about where the proxy listens and who holds the master key.
# 1. version, from the container or the Python environment
docker exec <litellm-container> litellm --version 2>/dev/null
pip show litellm 2>/dev/null | grep -i version
python -c 'import litellm, sys; print(litellm.__version__)' 2>/dev/null
# 2. is the admin endpoint reachable, and does the container run as root?
curl -s -o /dev/null -w '%{http_code}\n' -X POST http://127.0.0.1:4000/guardrails/test_custom_code # 401/403 without a key is expected
docker inspect <litellm-container> --format '{{.Config.User}}' # empty means rootIf step 1 shows 1.83.11 (or 1.83.10) or later, the code is fixed. If it shows an older version, the questions are whether the admin API is exposed and whether the master key is strong and secret: the endpoint needs that key, so the exposure that turns this from theoretical to urgent is a reachable proxy with a weak, shared or leaked master key. An empty user in step 2 confirms the default root container, which is why a successful escape is root; running the container as a non-root user limits the blast radius even before the patch.
Because the item is on the KEV list, look back. The signature is a POST to /guardrails/test_custom_code in the proxy or reverse-proxy access log, and a shell or network tool running under the LiteLLM process.
# requests to the custom-code endpoint
docker logs <litellm-container> 2>&1 | grep -i 'test_custom_code' | tail -50
zgrep -h 'test_custom_code' /var/log/nginx/access.log* 2>/dev/null | tail -50
# processes the proxy should not have spawned
docker top <litellm-container> 2>/dev/null | grep -vE 'python|litellm|uvicorn|gunicorn'
ps -ef | grep -iE 'litellm|uvicorn' | grep -vE 'grep' | headA call to that endpoint from anywhere other than your own administration, or a shell under the proxy, is not a false positive. The proxy holds the API keys for every model provider it fronts, so treat those as disclosed: rotate the LiteLLM master key and every provider key it stored, and rebuild the container from a fixed image rather than trusting a running one. Restoring a Linux Server covers the host side.
How to fix it
Upgrade LiteLLM to 1.83.11 (or the latest stable) and recreate the container or reinstall the package. The fix replaces the sandbox, so the endpoint stops being a code-execution sink.
# container: pull a fixed tag and recreate (pin an explicit version, not main-latest)
docker pull ghcr.io/berriai/litellm:v1.83.11-stable
docker compose up -d # or docker run with the new tag
# pip install
pip install --upgrade 'litellm>=1.83.11'
# Red Hat OpenShift AI: update to 3.3.4 or later per the Red Hat advisoryIf you cannot upgrade immediately, the advisories agree on the containment: block POST /guardrails/test_custom_code at a reverse proxy or API gateway, keep the admin API off the public internet, make the master key long and unique to this deployment, and run the container as a non-root user so an escape is not an escape to root. None of those is a substitute for the patch, because the endpoint stays a sink until the sandbox is replaced.
Do not treat the master-key requirement as safety on its own: a key that is shared across environments, committed to a repository or set to a default is exactly the condition an exploited-in-the-wild flaw needs. And do not run the proxy as root because the image does by default; a non-root user is the difference between a contained compromise and a root one.
Sources
- LiteLLM advisory GHSA-wxxx-gvqv-xp7p — the affected and patched versions, the RestrictedPython fix and the workaround (published 7 May 2026)
- X41 D-Sec advisory X41-2026-001 — the researcher write-up, the timeline and the authenticated-access requirement (8 April 2026)
- CVE-2026-40217 at CVE.org and NVD — the record, the 8.8 CVSS and the version range (last modified 19 November 2026)
- CISA Known Exploited Vulnerabilities — added 18 November 2026, action due 2 December 2026
- Trackers: Red Hat (Important; OpenShift AI 3.3.4) · Ubuntu and Debian (not applicable)
- EPSS score for this CVE, 28 November 2026
Related reading
- A Reverse Proxy with Automatic TLS — where to block an admin endpoint and keep it off the public internet
- What Ships in Your Container Image — why a container that runs as root turns a sandbox escape into a root one
- Getting Started with Docker — running a container as a non-root user, which bounds this flaw before the patch
- Hardening a Public-Facing Service Beyond the Basics — separating an admin surface from a public API, which is the real mitigation here
- Tailscale: Reaching Your Servers Without Opening Ports — keeping the admin API reachable only over a private network
This advisory page was assembled from the primary sources listed above on 29 November 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.

