CVE-2026-42203: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in BerriAI litellm
LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format. From version 1.80.5 to before version 1.83.7, the POST /prompts/test endpoint accepted user-supplied prompt templates and rendered them without sandboxing. A crafted template could run arbitrary code inside the LiteLLM Proxy process. The endpoint only checks that the caller presents a valid proxy API key, so any authenticated user could reach it. Depending on how the proxy is deployed, this could expose secrets in the process environment (such as provider API keys or database credentials) and allow commands to be run on the host. This issue has been patched in version 1.83.7.
AI Analysis
Technical Summary
LiteLLM versions from 1.80.5 to before 1.83.7 contain an improper neutralization of special elements used in a template engine (CWE-1336). The POST /prompts/test endpoint renders user-supplied templates without sandboxing, enabling arbitrary code execution within the proxy process. Since the endpoint requires only a valid proxy API key for access, any authenticated user can exploit this vulnerability. This may expose sensitive environment variables such as API keys or database credentials and allow execution of commands on the host system. The vulnerability has been fixed in version 1.83.7.
Potential Impact
An attacker with a valid proxy API key can execute arbitrary code within the LiteLLM proxy process, potentially exposing sensitive environment secrets like provider API keys or database credentials. This also allows execution of arbitrary commands on the host system, which can lead to full system compromise depending on deployment context. The CVSS 4.0 base score is 8.6 (high severity), reflecting network attack vector, low attack complexity, no user interaction, and high impact on confidentiality and integrity.
Mitigation Recommendations
Upgrade LiteLLM to version 1.83.7 or later, where this vulnerability is patched. Since the vendor advisory does not indicate any alternative mitigations or temporary fixes, applying the official update is the recommended remediation. Restrict access to the proxy API key to trusted users to reduce risk until patched.
CVE-2026-42203: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in BerriAI litellm
Description
LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format. From version 1.80.5 to before version 1.83.7, the POST /prompts/test endpoint accepted user-supplied prompt templates and rendered them without sandboxing. A crafted template could run arbitrary code inside the LiteLLM Proxy process. The endpoint only checks that the caller presents a valid proxy API key, so any authenticated user could reach it. Depending on how the proxy is deployed, this could expose secrets in the process environment (such as provider API keys or database credentials) and allow commands to be run on the host. This issue has been patched in version 1.83.7.
CVSS v4.0
Score 8.6high
Affected software
pkg:github/berriai/litellmRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
LiteLLM versions from 1.80.5 to before 1.83.7 contain an improper neutralization of special elements used in a template engine (CWE-1336). The POST /prompts/test endpoint renders user-supplied templates without sandboxing, enabling arbitrary code execution within the proxy process. Since the endpoint requires only a valid proxy API key for access, any authenticated user can exploit this vulnerability. This may expose sensitive environment variables such as API keys or database credentials and allow execution of commands on the host system. The vulnerability has been fixed in version 1.83.7.
Potential Impact
An attacker with a valid proxy API key can execute arbitrary code within the LiteLLM proxy process, potentially exposing sensitive environment secrets like provider API keys or database credentials. This also allows execution of arbitrary commands on the host system, which can lead to full system compromise depending on deployment context. The CVSS 4.0 base score is 8.6 (high severity), reflecting network attack vector, low attack complexity, no user interaction, and high impact on confidentiality and integrity.
Mitigation Recommendations
Upgrade LiteLLM to version 1.83.7 or later, where this vulnerability is patched. Since the vendor advisory does not indicate any alternative mitigations or temporary fixes, applying the official update is the recommended remediation. Restrict access to the proxy API key to trusted users to reduce risk until patched.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-25T05:04:37.027Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-42203","vendor":"Red Hat"}]
Threat ID: 69fd5dbdcbff5d86108b6457
Added to database: 05/08/2026, 03:51:25 UTC
Last enriched: 07/15/2026, 09:15:35 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 111
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.