Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍 PyPI
Not in CISA KEV

CVE-2026-59821 — litellm

Fix: BerriAI/litellm@e50b448

CVE-2026-59821 is a Code Injection vulnerability in litellm. A fix is available for litellm — see the affected versions and patch details below.

LiteLLM: Custom Code Guardrails production endpoints bypass code safety checks

Also known asGHSA-72m8-9m7m-h278PYSEC-2026-3478
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 19, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-59821.

EPSS Exploitation Probability

via FIRST.org ↗
0.9%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs59th percentile — riskier than 59% of all scored CVEsHighest risk
0.00%0.47%0.94%1.40%0.4%0.7%0.9%0.9%Aug 26Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

Real-World Exposure

1 pkg affected
🐍litellm

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Impact

LiteLLM's Custom Code Guardrails production create/update paths did not apply the same sandboxing and validation used by the test endpoint.

A privileged user with access to create or update guardrails could submit custom Python code that executed in the LiteLLM proxy environment. In deployments without a configured master key, callers could be treated as proxy administrators, making this reachable without intended administrative authorization.

This could allow arbitrary code execution in the LiteLLM proxy container and exposure of secrets available to the process.

Patches

The issue is fixed in 1.82.0-stable.

LiteLLM recommend upgrading to 1.82.0-stable or later.

Workarounds

If upgrading is not immediately possible:

  1. Restrict access to POST /guardrails and PUT /guardrails/{guardrail_id} to trusted administrators only.
  2. Ensure LITELLM_MASTER_KEY is configured.
  3. Avoid enabling Custom Code Guardrails for untrusted users.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIlitellmall versions1.82.0pip install --upgrade 'litellm==1.82.0'

Affected Products

1 product · 2 configurations
Application
litellmlitellm
< 1.82.0
1 version
1.82.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for litellm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update litellm to 1.82.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-59821 is resolved across your whole dependency graph.

  3. Workarounds

    Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatImportant

Red Hat rates this flaw with higher severity than the upstream GitHub Security Advisory (GHSA-72m8-9m7m-h278, CVSS v4.0 2.1, Low). Red Hat scored this CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H (7.2, Important) because a successful exploit grants arbitrary Python code execution within the LiteLLM proxy process,…

Workaround published by Red Hat
Upgrade litellm to 1.82.0 or later, which enforces the same code-safety checks on the guardrail create/update endpoints as the test endpoint. If upgrading is not immediately possible, restrict access to POST /guardrails and PUT /guardrails/{guardrail_id} to trusted administrators only, ensure LITELLM_MASTER_KEY is configured so unauthenticated callers are not treated as proxy administrators, and avoid enabling Custom Code Guardrails for untrusted users.
Source: Red Hat security advisory for CVE-2026-59821 (CC BY 4.0)

Frequently Asked Questions

### Impact LiteLLM's Custom Code Guardrails production create/update paths did not apply the same sandboxing and validation used by the test endpoint. A privileged user with access to create or update guardrails could submit custom Python code that executed in the LiteLLM proxy environment. In deployments without a configured master key, callers could be treated as proxy administrators, making this reachable without intended administrative authorization. This could allow arbitrary code execution in the LiteLLM proxy container and exposure of secrets available to the process. ### Patches T
O3 Security · Impact-Aware SCA

Is CVE-2026-59821 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2026-59821: litellm RCE — Fixed in 1.82.0