CVE-2026-40217 in plain words
Written by Varaxon from the sources below. Last checked .
- What an attacker can do
- The LiteLLM proxy has a /guardrails/test_custom_code endpoint that runs Python code sent to it inside a home-made sandbox. The sandbox can be escaped with bytecode tricks, which lets the caller run any code in the proxy process. That process runs as root in the default Docker image. LiteLLM says reaching the endpoint needs a proxy admin credential in default setups, and the finder, X41 D-Sec, says it needs the master key.
- Who is affected
- LiteLLM 1.81.8 up to but not including 1.83.10, per the LiteLLM advisory on GitHub. NVD describes it as LiteLLM through 2026-04-08.
- What to do first
- The LiteLLM advisory lists 1.83.10 as the first patched version and its text says to upgrade to 1.83.11 or later, where the sandbox was replaced with RestrictedPython; 1.83.11 or later covers both. If you cannot upgrade yet, block POST /guardrails/test_custom_code at your reverse proxy or API gateway, keep the master key with trusted admins only, and keep the admin port off untrusted networks.
How to check if you are exposed to CVE-2026-40217
- Find every BerriAI LiteLLM system you or your clients run, including ones exposed to the internet. Those come first: CISA only lists flaws attackers are already using.
- Compare each version with the fixed versions in the vendor advisory below. Where no fix exists yet, apply the vendor’s mitigation or take the system off the internet.
- Run a credentialed vulnerability scan to catch the systems you missed, then check that the next scan no longer reports CVE-2026-40217.
US federal agencies had to fix this by 2026-12-02. Everyone else should treat that deadline as a guide: if it has passed, this is overdue.
Affected versions
Versions the National Vulnerability Database lists as vulnerable to CVE-2026-40217. Check the vendor advisory for the exact fixed builds before you sign anything off.
| Product | Vulnerable versions |
|---|---|
| Litellm | from 1.81.8 before 1.83.10 |
| Redhat Ansible Automation Platform | from 2.0 before 2.6-9 |
| Redhat Openshift AI | from 3.3 before 3.3.4 |
| Redhat Openshift Lightspeed | all versions |
Timeline
- · Published in the National Vulnerability Database
- · Added to CISA's Known Exploited Vulnerabilities catalog, 222 days after it was published
- · Fix-by date for US federal agencies, still ahead
Vendor advisories and fixes
Weakness type
More exploited BerriAI vulnerabilities
CISA lists 4 exploited BerriAI vulnerabilities. The closest matches:
Keep going
- Exploited this month
- All exploited CVEs
- Check another CVE
- What is CISA KEV?
- What is EPSS?
- CISA KEV report, October 2026
Sources: CISA Known Exploited Vulnerabilities catalog (version 2026.11.18); EPSS data from FIRST.org; CVSS and descriptions from the NIST National Vulnerability Database. Checked 2026-11-20. This product uses the NVD API but is not endorsed or certified by the NVD.
