CVE-2026-59821: CWE-94: Improper Control of Generation of Code ('Code Injection') in BerriAI litellm
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.
AI Analysis
Technical Summary
LiteLLM, a proxy server for calling LLM APIs, had an improper control of code generation (CWE-94) vulnerability in its Custom Code Guardrails create and update paths before version 1.82.0-stable. Unlike the test endpoint, these paths lacked sandboxing and validation, enabling privileged users to inject and execute arbitrary Python code in the proxy environment. This could lead to exposure of secrets available to the process. The vulnerability has a CVSS 4.0 base score of 2.1, indicating low severity. The issue is resolved in version 1.82.0-stable.
Potential Impact
A privileged user with access to create or update guardrails could execute arbitrary Python code within the LiteLLM proxy environment. This could lead to exposure of secrets accessible to the process running LiteLLM. The impact is limited by the requirement for privileged access and the low CVSS score.
Mitigation Recommendations
Upgrade LiteLLM to version 1.82.0-stable or later, where this vulnerability is fixed. No other official remediation or temporary fix information is provided. Since this is not a cloud service, users must apply the update themselves.
CVE-2026-59821: CWE-94: Improper Control of Generation of Code ('Code Injection') in BerriAI litellm
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 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 an improper control of code generation (CWE-94) vulnerability in its Custom Code Guardrails create and update paths before version 1.82.0-stable. Unlike the test endpoint, these paths lacked sandboxing and validation, enabling privileged users to inject and execute arbitrary Python code in the proxy environment. This could lead to exposure of secrets available to the process. The vulnerability has a CVSS 4.0 base score of 2.1, indicating low severity. The issue is resolved in version 1.82.0-stable.
Potential Impact
A privileged user with access to create or update guardrails could execute arbitrary Python code within the LiteLLM proxy environment. This could lead to exposure of secrets accessible to the process running LiteLLM. The impact is limited by the requirement for privileged access and the low CVSS score.
Mitigation Recommendations
Upgrade LiteLLM to version 1.82.0-stable or later, where this vulnerability is fixed. No other official remediation or temporary fix information is provided. Since this is not a cloud service, users must apply the update themselves.
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/16/2026, 10:06:34 UTC
Last updated: 08/22/2026, 10:52:10 UTC
Views: 96
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.