LiteLLM: sandbox escape in custom-code guardrail (CVE-2026-40217) exploited in the wild
Published 18/11/2026 20:51
Timeline
3 events over 19 h
- 18/11/2026ConfirmedCISA Known Exploited Vulnerabilities+0 min
- 18/11/2026ExploitedCISA Known Exploited Vulnerabilities+19 h
- 18/11/2026 20:51Published on WatchtowerPro CISO
In short
An attacker with a login to a LiteLLM proxy can abuse the /guardrails/test_custom_code endpoint to run their own code on the server through bytecode rewriting. CISA lists the flaw as known exploited. Update LiteLLM to a fixed release (the version was not found in the signals) and restrict access to the endpoint. Shodan recognises at least 244,091 internet-facing LiteLLM servers worldwide, 50,894 of them in the EU (18/11/2026); the real number is likely higher, and how many run an affected version is not yet known.
How bad is it
High. An attacker with a low-privilege login who can reach a LiteLLM server over the network can run their own code on it, and CISA lists the flaw as exploited.
Being exploited.
Severity score
No CVSS score published yet
CVE-2026-40217: no score published yet. A missing score is never read as 0.
What an attacker needs
- Internet access to itNot published yet
- A loginNot published yet
- A user to clickNot published yet
- Special settingsNot published yet
Red helps the attacker, blue holds them back, grey is not published yet.
If it works, an attacker can
- Run their own code on the system
Type: remote code execution.
A score is the worst case for the flaw, not a verdict on any one system. How we score · ReconX customers see which of their own systems are affected.
Affected versions
- LiteLLM (litellm:litellm): NVD's CPE range is up to and including 2026-04-08, given as a date and not as a version number.
What to do now
- Update LiteLLM to a release that fixes CVE-2026-40217. The exact fixed version was not found in the sources read, so check the BerriAI LiteLLM security advisory for it.
- Treat exposed servers as possibly compromised, because CISA lists the flaw as known exploited: review logs for requests to /guardrails/test_custom_code and for unexpected code or processes.
- If you run Red Hat packages, check Red Hat errata RHSA-2026:24866 and RHSA-2026:30056, which NVD lists as references.
- Until you have updated, restrict who can log in to the LiteLLM proxy and who can reach the /guardrails/test_custom_code endpoint. This reduces exposure but does not make a server safe.
ReconX customers see the full notice - and their own systems
Our customers are alerted at every phase. Until a patch exists, the ReconX agent watches their servers from the inside for anomalies, and our outside view - the attacker's view - shows which systems to fix first.
In ReconX: the full analysis, 5 open questions, followed up as sources answer and all 2 sources with their dates. And technology matching: which of your systems run BerriAI LiteLLM, at which version, fixed or not - and what each one needs.
Main sources
Known exploited: BerriAI LiteLLM - BerriAI LiteLLM Unprotected Alternate Channel Vulnerability Vendor · CVE-2026-40217 Detail - NVD Research