CVE-2026-42203
JSON

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 packageVersionsReported by
BerriAI litellm>= 1.80.5, < 1.83.7CVE List
exploit-intelligence-tech-preview/vulnerability-analysis-rhel9Not specifiedCVE List
ansible-automation-platform-26/lightspeed-chatbot-rhel9Not specifiedCVE List
rhoai/odh-llama-stack-core-rhel9Not specifiedCVE List
litellm (PyPI)from 1.80.5 before 1.83.7GitHub Advisory Database, PyPA Advisory Database
litellm litellmfrom 1.80.5 before 1.83.7NVD

All scores

GitHub_M8.6high CVSS:4.0CVSS: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-SADP8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS: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

CWE-94CWE-1336

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

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:

  1. Block POST /prompts/test at your reverse proxy or API gateway.
  2. 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

SourceRecordLicence
CVE ListCVE-2026-42203 changed 2026-07-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-xqmj-j6mv-4862 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-42203 changed 2026-10-26Public domain
PyPA Advisory DatabasePYSEC-2026-2602 changed 2026-07-13CC-BY-4.0