LiteLLM: Server-Side Template Injection in /prompts/test endpoint
Impact
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.
Proxy deployments running an affected version are in scope.
Patches
The issue is fixed in 1.83.7-stable. The fix switches the prompt template renderer to a sandboxed environment that blocks the attributes this attack relies on.
LiteLLM recommends upgrading to 1.83.7-stable or later.
Workarounds
If upgrading is not immediately possible:
- Block
POST /prompts/testat your reverse proxy or API gateway. - Review and rotate API keys that should not have access to prompt management routes.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | litellm | >= 1.80.5, < 1.83.7 | 1.83.7 |
References
- https://github.com/BerriAI/litellm/security/advisories/GHSA-xqmj-j6mv-4862
- https://nvd.nist.gov/vuln/detail/CVE-2026-42203
- https://github.com/BerriAI/litellm
- https://github.com/BerriAI/litellm/releases/tag/v1.83.7-stable
- https://pypi.org/project/litellm
- https://github.com/advisories/GHSA-xqmj-j6mv-4862
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N- Weakness (CWE)
CWE-1336- Platform
- Python (PyPI)
- Package
litellm- Disclosed
- 24.04.2026
- Updated
- 11.10.2026 15:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-2602 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-xqmj-j6mv-4862 - CC BY 4.0
Vulnerability history: litellm
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 42
- First → latest
- 04.2024 09.2026
- Without a fix
- 14
- Exploited in attacks
- 3
Severity breakdown
- Critical 7
- High 17
- Medium 8
- Low 9
- Unrated 1
Disclosures per year
- 2024: 8
- 2025: 6
- 2026: 28
-
LiteLLM: Server-Side Template Injection in /prompts/test endpoint this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.