CVE-2026-59821
Received Received - Intake

Custom Code Execution in LiteLLM Proxy via Guardrail Bypass

Vulnerability report for CVE-2026-59821, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-08

Last updated on: 2026-07-08

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-08
Last Modified
2026-07-08
Generated
2026-07-09
AI Q&A
2026-07-08
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
litellm litellm to 1.82.0-stable (exc)
berriai litellm 1.82.0-stable

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-59821 is a vulnerability in LiteLLM's Custom Code Guardrails feature where the production create and update endpoints did not apply the same sandboxing and validation as the test endpoint.

This allowed a privileged user with access to these endpoints to submit custom Python code that would execute within the LiteLLM proxy environment.

In some deployments without a configured master key, this could be exploited to gain proxy administrator privileges, enabling arbitrary code execution and potential exposure of secrets available to the process.

The issue was fixed in version 1.82.0-stable by adding stricter authentication checks, a dedicated code validator to block dangerous code patterns, and improved error handling.

Impact Analysis

If exploited, this vulnerability could allow a privileged user or attacker with access to the vulnerable endpoints to execute arbitrary Python code within the LiteLLM proxy environment.

This could lead to exposure of sensitive secrets available to the process and potentially allow the attacker to gain proxy administrator privileges.

However, exploitation requires high privileges and the absence of a configured master key, and the overall severity is considered low.

Mitigation Strategies

To mitigate this vulnerability, you should upgrade LiteLLM to version 1.82.0-stable or later, where the issue is fixed.

If upgrading immediately is not possible, restrict access to the vulnerable create and update guardrail endpoints to only trusted privileged users.

Ensure that a master key is configured in your LiteLLM deployment to prevent unauthorized privilege escalation.

Compliance Impact

The vulnerability allows a privileged user to execute arbitrary Python code within the LiteLLM proxy environment, potentially exposing secrets available to the process.

In deployments without a configured master key, this could lead to proxy administrator privileges and arbitrary code execution, which may risk unauthorized access to sensitive data.

Such unauthorized access and potential data exposure could negatively impact compliance with standards like GDPR and HIPAA, which require strict controls on data confidentiality and access.

However, the vulnerability has a low severity score (2.1) and requires high privileges to exploit, limiting its impact.

Users are advised to upgrade to version 1.82.0-stable or restrict access and configure the master key to mitigate risks.

Detection Guidance

This vulnerability involves the Custom Code Guardrails feature in LiteLLM versions prior to 1.82.0-stable, where create and update endpoints do not properly sandbox or validate submitted Python code. Detection would focus on identifying usage of vulnerable LiteLLM versions and monitoring access to guardrail management endpoints.

To detect this vulnerability on your system or network, you can:

  • Check the LiteLLM version running on your system to ensure it is 1.82.0-stable or later.
  • Monitor network traffic for requests to the guardrail create or update endpoints, which may indicate attempts to exploit the vulnerability.
  • Audit logs for privileged user activity related to guardrail creation or updates.

Specific commands might include:

  • To check the LiteLLM version, run a command like: `litellm --version` or check the installed package version depending on your deployment.
  • Use network monitoring tools (e.g., tcpdump, Wireshark) to filter traffic to the LiteLLM proxy server on relevant ports and look for HTTP requests to endpoints related to guardrail creation or updates.
  • Review application or system logs for suspicious activity involving guardrail endpoints or unexpected Python code submissions.

Since the vulnerability requires privileged user access, ensuring proper authentication and restricting access to these endpoints is critical.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-59821. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart