CVE-2026-42203: LiteLLM: Server-Side Template Injection in /prompts/test endpoint
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
LiteLLM Proxyto a version that resolves this vulnerability.Fixed in 1.83.7 - Configuration
Ensure prompt template rendering in the /prompts/test endpoint is sandboxed; versions before 1.83.7 rendered user-supplied prompt templates without sandboxing.
LiteLLM Proxy (/prompts/test endpoint) prompt template rendering sandboxing = enabled - Compensating control
Restrict network/access to the LiteLLM Proxy /prompts/test endpoint so only trusted users/services can reach it, since the endpoint only validates a valid proxy API key and authenticated users could access it.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-42203?
CVE-2026-42203 has been classified as a high severity vulnerability due to the potential for server-side template injection.
How do I fix CVE-2026-42203?
To remediate CVE-2026-42203, upgrade LiteLLM to version 1.83.7 or later.
What systems are affected by CVE-2026-42203?
CVE-2026-42203 affects LiteLLM versions from 1.80.5 to before 1.83.7.
What is the impact of CVE-2026-42203?
The impact of CVE-2026-42203 includes the risk of attackers exploiting the vulnerability to execute arbitrary code on the server.
What is server-side template injection in CVE-2026-42203?
Server-side template injection in CVE-2026-42203 allows unauthorized users to submit malicious templates that the server processes, potentially leading to data leakage or remote code execution.