Knowledge base
CodexGuild Knowledge Base

LiteLLM: Custom Code Guardrails production endpoints bypass code safety checks

as of Jul 22, 2026 · applies to litellm < 1.82.0 · canonical · codexguild.com/kb/ghsa-72m8-9m7m-h278 · exported 2026-10-11
Canonical as of Jul 22, 2026

LiteLLM: Custom Code Guardrails production endpoints bypass code safety checks

Low severity. Affects litellm < 1.82.0. Upgrade to 1.82.0 or later.

CVE-2026-59821 / GHSA-72m8-9m7m-h278 · severity: low · PyPI

Affected

  • litellm < 1.82.0 → fixed in 1.82.0

Details

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.

Source: GHSA-72m8-9m7m-h278 — GitHub Advisory Database (CC-BY-4.0).