{"id":"CVE-2026-59821","aliases":["GHSA-72m8-9m7m-h278","PYSEC-2026-3478"],"url":"https://o3.security/vulnerability/CVE-2026-59821","summary":"LiteLLM: Custom Code Guardrails production endpoints bypass code safety checks","details":"### Impact\n\nLiteLLM's Custom Code Guardrails production create/update paths did not apply the same sandboxing and validation used by the test endpoint.\n\nA 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.\n\nThis could allow arbitrary code execution in the LiteLLM proxy container and exposure of secrets available to the process.\n\n### Patches\n\nThe issue is fixed in `1.82.0-stable`.\n\nLiteLLM recommend upgrading to `1.82.0-stable` or later.\n\n### Workarounds\n\nIf upgrading is not immediately possible:\n\n1. Restrict access to `POST /guardrails` and `PUT /guardrails/{guardrail_id}` to trusted administrators only.\n2. Ensure `LITELLM_MASTER_KEY` is configured.\n3. Avoid enabling Custom Code Guardrails for untrusted users.","published":"2026-07-08T19:14:13.265Z","modified":"2026-08-12T03:51:31.693950412Z","cvss":null,"epss":{"score":0.00655,"percentile":0.49416,"asOf":"2026-09-14"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"litellm","fixedVersion":"1.82.0"}],"fix":{"url":"https://github.com/BerriAI/litellm/commit/e50b4486d0f7aa0497185a1ebcdd2c91f1769eba","label":"BerriAI/litellm@e50b448"},"references":[{"type":"WEB","url":"https://github.com/BerriAI/litellm/releases/tag/v1.82.0-stable"},{"type":"ADVISORY","url":"https://github.com/BerriAI/litellm/security/advisories/GHSA-72m8-9m7m-h278"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59821.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59821"},{"type":"FIX","url":"https://github.com/BerriAI/litellm/commit/e50b4486d0f7aa0497185a1ebcdd2c91f1769eba"},{"type":"PACKAGE","url":"https://github.com/BerriAI/litellm"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:31.693950412Z"}}