---
id: CVE-2026-59821
title: >-
  LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native)
  format
summary: >-
  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 th…
severity: high
cvss: 7.2
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H'
cwe:
  - CWE-94
vendor: litellm
product: litellm
affected:
  - litellm < 1.82.0
  - litellm = 1.82.0
patched:
  - litellm 1.82.0
published: '2026-07-08'
updated: '2026-07-13'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-59821'
references:
  - url: >-
      https://github.com/BerriAI/litellm/commit/e50b4486d0f7aa0497185a1ebcdd2c91f1769eba
    label: security-advisories@github.com
  - url: 'https://github.com/BerriAI/litellm/releases/tag/v1.82.0-stable'
    label: security-advisories@github.com
  - url: 'https://github.com/BerriAI/litellm/security/advisories/GHSA-72m8-9m7m-h278'
    label: security-advisories@github.com
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-59821'
  - url: 'https://github.com/BerriAI/litellm'
tags:
  - nvd
  - osv
  - pip
epss: 0.00904
epssPercentile: 0.58109
ingestedAt: '2026-07-13T14:27:26.911Z'
aliases:
  - GHSA-72m8-9m7m-h278
  - PYSEC-2026-3478
ecosystem: pip
---

## Overview

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.

## Affected

- `litellm < 1.82.0`
- `litellm = 1.82.0`

## Remediation

Upgrade past the affected range:

- `litellm 1.82.0`

## Package advisory (CVE-2026-59821)

Affected packages:

- `litellm < 1.82.0`

Patched in:

- `litellm 1.82.0`

Source: https://osv.dev/vulnerability/GHSA-72m8-9m7m-h278
