8.6high
LiteLLM: Server-Side Template Injection in /prompts/test endpoint
- Severity
- 8.6high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.37% (higher than 33% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-xqmj-j6mv-4862PYSEC-2026-2602
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| BerriAI litellm | >= 1.80.5, < 1.83.7 | CVE List |
| exploit-intelligence-tech-preview/vulnerability-analysis-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/lightspeed-chatbot-rhel9 | Not specified | CVE List |
| rhoai/odh-llama-stack-core-rhel9 | Not specified | CVE List |
| litellm (PyPI) | from 1.80.5 before 1.83.7 | GitHub Advisory Database, PyPA Advisory Database |
| litellm litellm | from 1.80.5 before 1.83.7 | NVD |
All scores
| GitHub_M | 8.6high CVSS:4.0 | 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 |
| redhat-SADP | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| GitHub | high CVSS:4.0 | 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 |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | Not scored CVSS:4.0 | 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 |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
NVD (es)
LiteLLM es un servidor proxy (Gateway de IA) para llamar a las API de LLM en formato OpenAI (o nativo). Desde la versión 1.80.5 hasta antes de la versión 1.83.7, el endpoint POST /prompts/test aceptaba plantillas de prompt proporcionadas por el usuario y las renderizaba sin sandboxing. Una plantilla manipulada podría ejecutar código arbitrario dentro del proceso del Proxy de LiteLLM. El endpoint solo verifica que el llamador presente una clave API de proxy válida, por lo que cualquier usuario autenticado podría alcanzarlo. Dependiendo de cómo se despliegue el proxy, esto podría exponer secretos en el entorno del proceso (como claves API de proveedor o credenciales de base de datos) y permitir que se ejecuten comandos en el host. Este problema ha sido parcheado en la versión 1.83.7.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42203 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-xqmj-j6mv-4862 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-42203 changed 2026-10-26 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2602 changed 2026-07-13 | CC-BY-4.0 |