CVE-2026-40217, a vulnerability in LiteLLM (by BerriAI), open-source software that puts one front door in front of many AI services, was added to the KEV catalog of CISA (the US cybersecurity agency) on November 18, 2026. KEV is a catalog of vulnerabilities that have been exploited in real attacks. The LiteLLM proxy has an API, "POST /guardrails/test_custom_code", for trying out the Python code used in guardrails (the mechanism that checks what goes into and out of an AI model). The API runs the submitted Python code in the project's own simple sandbox, but the sandbox can be escaped, and arbitrary code can then run inside the proxy process (the maintainer's advisory).
If you run a LiteLLM proxy yourself, first check which version you use and update to 1.83.11 or later. If you cannot update right away, the maintainer's workaround is to block requests to this API at your reverse proxy. According to the maintainer, reaching this API requires a proxy-admin credential in default configurations. However, the proxy runs as root in the default official Docker image, so the impact is larger if an attack succeeds.
Where the score comes from, and why the sources disagree: 8.8 (CVSS v3.1, HIGH) is the value in the GitHub Advisory Database, and NVD also lists the same 8.8 as an assessment from the CVE record side. NIST had not added its own assessment when we checked on November 19. The vector reads: network, low complexity, low privileges required, no user interaction, scope unchanged, and high impact on confidentiality, integrity and availability. The sources do not agree on the number. The score the maintainer put on its own repository advisory is CVSS v4.0 5.9 (severity "moderate"), with attack complexity and required privileges both rated "high". The GitHub Advisory Database also lists a v4.0 score of 7.5, and the discoverer, X41, gave a v4.0 score of 8.7. This article uses the v3.1 value of 8.8, which NVD also lists. The steps you need to take are the same whichever number you read.
What is happening (as far as it is public)
- ▸CVE-2026-40217: The LiteLLM proxy's POST /guardrails/test_custom_code runs Python code submitted by a user in a sandbox the project built itself. The sandbox can be escaped with a bytecode-level technique (Python's internal instructions), allowing arbitrary code execution inside the proxy process (the maintainer's advisory). The weakness type is CWE-913 (Improper Control of Dynamically-Managed Code Resources). The GitHub Advisory Database and CISA's KEV also list CWE-420 (Unprotected Alternate Channel), and the KEV entry is named "Unprotected Alternate Channel"
- ▸Affected versions: The maintainer's advisory (the GitHub Advisory Database says the same) lists the pip package litellm as "1.81.8 or later, before 1.83.10", with the patched version "1.83.10 or later" in its structured field. However, the body of the same advisory says "fixed in 1.83.11; the hand-rolled sandbox was replaced with RestrictedPython; upgrade to 1.83.11 or later". Because the fixed-version numbers disagree, this article recommends the newer one, 1.83.11 or later. The sources we could confirm say nothing about versions before 1.81.8
- ▸Required privileges: The maintainer writes that a proxy-admin credential is required in default configurations. The discoverer X41 also describes an "authenticated HTTP API request". We found no statement in the sources we could confirm that anyone can exploit it without authentication
- ▸Timing of disclosure and fix: The maintainer's repository advisory was published on May 7, 2026 (updated June 30), and the GitHub Advisory Database listed it on May 11. On PyPI, 1.83.10 was published on April 19 and 1.83.11 on April 22. The fixed versions had been available about seven months before the KEV addition
- ▸KEV details: Added on November 18, with a due date of December 2 for US federal agencies. Known ransomware use is listed as "Unknown", and forensic triage is listed as "No"
What to do today (if you run a LiteLLM proxy)
- ✓★Step 1: Check your version. If you installed with pip, run pip show litellm; if you use a Docker image, check the image tag. Anything before 1.83.11 needs the update
- ✓★Step 2: Update to 1.83.11 or later. Update in the way you installed it (pip, a Docker image, and so on). As of November 19, the newest version on PyPI is 1.110.1. After updating, check that the proxy still works
- ✓Step 3 (if you cannot update right away): Block the API at your reverse proxy. At a reverse proxy such as nginx or Caddy, block requests to POST /guardrails/test_custom_code (the maintainer's workaround). The workaround is not a substitute for updating, so update as soon as you can
- ✓Step 4: Review how admin credentials are handled. (Our addition) By default, a proxy-admin credential is required to reach this API. Check that you have not shared the admin key and that the proxy's admin API and screens are not reachable by anyone on the internet
- ✓Step 5: If it may have been exploited, consider replacing keys. (Our addition) LiteLLM puts one front door in front of many AI services (X41's description), so the proxy probably holds API keys for those services. If someone may have operated it from outside with an admin credential before you updated, consider reissuing the API keys you registered. How attacks have actually happened has not been published, so this does not mean keys were certainly leaked
What we could not confirm
- ▸The details of the exploitation. We could confirm that CISA listed it in KEV. The attacks themselves, their number, the organizations targeted, and how attackers obtained an admin credential were not in the sources we could confirm
- ▸NIST's assessment. As of November 19, NVD has no NIST assessment. NVD's description says "LiteLLM through 2026-04-08", which is worded differently from the GitHub range (before 1.83.10)
- ▸Whether the fixed version is 1.83.10 or 1.83.11. The structured field of the maintainer's advisory says "patched versions: 1.83.10 or later", while the body says "fixed in 1.83.11". The sources we could confirm do not let us decide which is right. We recommend the newer one, 1.83.11 or later
- ▸The "patched versions" and "CVE" fields on the discoverer X41's page. We used X41's page as a source for the technical description and its assessment (an authenticated request, the default Docker image running as root, and a CVSS v4.0 score of 8.7). However, "Confirmed Patched Versions: TBD" and "CVE: TBD" are as at publication and do not reflect the current state, so we did not use them to judge fixed versions or the CVE
If you share this, share these three lines
- ▸CVE-2026-40217 in LiteLLM, software that puts one front door in front of many AI services, was added to CISA's "known exploited" catalog (KEV) on November 18. The guardrail test API may let someone run code inside the proxy process
- ▸★Update to 1.83.11 or later. If you cannot update right away, block POST /guardrails/test_custom_code at your reverse proxy
- ▸Protect the admin key. By default, a proxy-admin credential is needed to reach this API. Review key sharing and whether the admin API is exposed to the internet
Pages this article is based on
- GitHub: LiteLLM maintainer's security advisory (GHSA-wxxx-gvqv-xp7p, CVE-2026-40217)↗
- GitHub Advisory Database: GHSA-wxxx-gvqv-xp7p (source of the CVSS v3.1 8.8 and the May 11 listing date)↗
- X41 D-Sec: discoverer's advisory X41-2026-001 (technical description and CVSS v4.0 8.7; "patched versions" and "CVE" fields not used)↗
- NVD: CVE-2026-40217↗
- CISA: Known Exploited Vulnerabilities Catalog (CVE-2026-40217)↗
- GitHub: LiteLLM release v1.83.10-stable↗
- PyPI: litellm release history↗
