CVE-2026-59821 LiteLLM: Custom Code Guardrails production endpoints bypass code safety checks

Low 2.1 Published Updated

Privileged users can bypass safety checks to execute arbitrary Python code in the LiteLLM proxy, potentially exposing secrets.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-59821?

CVE-2026-59821 is a low-severity code injection vulnerability in BerriAI litellm, published on 8 Jul 2026. An attacker needs administrator access to exploit it, with no action from the victim.

Official description

LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format. Prior to 1.82.0-stable, LiteLLM's Custom Code Guardrails production create and update paths did not apply the same sandboxing and validation used by the test endpoint, allowing a privileged user with access to create or update guardrails to submit custom Python code that executed in the LiteLLM proxy environment and could expose secrets available to the process. This issue is fixed in version 1.82.0-stable.

Weakness: CWE-94

Which versions are affected by CVE-2026-59821?

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

PackageAffectedFixed in
litellm PyPIAll versions1.82.0
litellm PyPIAll versions1.82.0
litellm PyPIAll versions1.82.0

Products include Litellm Litellm.

How do I fix CVE-2026-59821?

Upgrade litellm to 1.82.0 or later.

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

Is CVE-2026-59821 being exploited?

There is no known exploitation of CVE-2026-59821 in the wild and no public exploit code.

Sources

Also known as ECHO-4543-9144-2cc5, GHSA-72m8-9m7m-h278, MINI-93mg-g88v-7f42, MINI-mc35-mprm-v54q, MINI-r8m4-cr69-v9g3, MINI-x8qv-vw88-8cxr and 1 more.

Is CVE-2026-59821 in your software?

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

Check your SBOMs for free