CVE-2026-40217 LiteLLM has a sandbox escape in custom-code guardrail

High 8.8 Published Updated

Remote attackers can execute arbitrary code via bytecode rewriting in the LiteLLM library, requiring immediate upgrades.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-40217?

CVE-2026-40217 is a high-severity code injection vulnerability in BerriAI LiteLLM, published on 10 Apr 2026. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI.

Weakness: CWE-94, CWE-420

Which versions are affected by CVE-2026-40217?

3 open source packages ship an affected version, including litellm. It affects 1 product.

PackageAffectedFixed in
litellm PyPIFrom 1.81.81.83.10
litellm PyPIFrom 1.81.81.83.10
litellm PyPIFrom 1.81.81.83.10

Products include Litellm Litellm.

How do I fix CVE-2026-40217?

Upgrade litellm to 1.83.10 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-40217 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40217 exists.

Public exploit code: 1 Nuclei template and 1 proofs of concept on GitHub.

Sources

Also known as CLEANSTART-2026-IM10707, CLEANSTART-2026-UL91233, ECHO-c6d4-cf5f-a050, GHSA-wxxx-gvqv-xp7p, MINI-377r-r3c8-mhq7, MINI-3vcp-7r7v-gxq6 and 13 more.

Is CVE-2026-40217 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free