CVE-2026-59821: CWE-94: Improper Control of Generation of Code ('Code Injection') in BerriAI litellm
CVE-2026-59821 is a code injection vulnerability in BerriAI's LiteLLM proxy server prior to version 1.82.0-stable. The issue arises because the Custom Code Guardrails create and update endpoints did not enforce the same sandboxing and validation as the test endpoint, allowing privileged users to submit custom Python code that executes within the LiteLLM proxy environment. This could potentially expose secrets accessible to the process. The vulnerability is fixed in version 1.82.0-stable.
AI Analysis
Technical Summary
LiteLLM, a proxy server for calling LLM APIs, had a vulnerability in its Custom Code Guardrails production create and update paths before version 1.82.0-stable. These paths lacked the sandboxing and validation protections present in the test endpoint, enabling a privileged user with access to create or update guardrails to inject and execute arbitrary Python code within the proxy environment. This improper control of code generation (CWE-94) could lead to exposure of secrets available to the process. The issue is resolved in version 1.82.0-stable.
Potential Impact
A privileged user with access to create or update Custom Code Guardrails could execute arbitrary Python code in the LiteLLM proxy environment, potentially exposing sensitive secrets accessible to the process. The CVSS score is low (2.1), reflecting the requirement for privileged access and limited scope of impact.
Mitigation Recommendations
Upgrade to LiteLLM version 1.82.0-stable or later, where this vulnerability is fixed. No official patch advisory is provided, but the fix is included in the stated version. Until upgrading, restrict privileged user access to the Custom Code Guardrails create and update functionality to trusted personnel only.
CVE-2026-59821: CWE-94: Improper Control of Generation of Code ('Code Injection') in BerriAI litellm
Description
CVE-2026-59821 is a code injection vulnerability in BerriAI's LiteLLM proxy server prior to version 1.82.0-stable. The issue arises because the Custom Code Guardrails create and update endpoints did not enforce the same sandboxing and validation as the test endpoint, allowing privileged users to submit custom Python code that executes within the LiteLLM proxy environment. This could potentially expose secrets accessible to the process. The vulnerability is fixed in version 1.82.0-stable.
CVSS v4.0
Score 2.1low
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
LiteLLM, a proxy server for calling LLM APIs, had a vulnerability in its Custom Code Guardrails production create and update paths before version 1.82.0-stable. These paths lacked the sandboxing and validation protections present in the test endpoint, enabling a privileged user with access to create or update guardrails to inject and execute arbitrary Python code within the proxy environment. This improper control of code generation (CWE-94) could lead to exposure of secrets available to the process. The issue is resolved in version 1.82.0-stable.
Potential Impact
A privileged user with access to create or update Custom Code Guardrails could execute arbitrary Python code in the LiteLLM proxy environment, potentially exposing sensitive secrets accessible to the process. The CVSS score is low (2.1), reflecting the requirement for privileged access and limited scope of impact.
Mitigation Recommendations
Upgrade to LiteLLM version 1.82.0-stable or later, where this vulnerability is fixed. No official patch advisory is provided, but the fix is included in the stated version. Until upgrading, restrict privileged user access to the Custom Code Guardrails create and update functionality to trusted personnel only.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-07T15:00:50.978Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a4ea889c9d9e3dbe3a526a0
Added to database: 07/08/2026, 19:44:09 UTC
Last enriched: 07/08/2026, 19:58:54 UTC
Last updated: 07/08/2026, 20:20:59 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.