id: PYSEC-2026-2602 published: "2026-07-13T15:02:53.267150Z" modified: "2026-07-13T16:04:36.854814Z" aliases: - CVE-2026-42203 - GHSA-xqmj-j6mv-4862 summary: "LiteLLM: Server-Side Template Injection in /prompts/test endpoint" details: "### Impact\nThe `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.\n\nThe 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.\n\nProxy deployments running an affected version are in scope.\n\n### Patches\nThe 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.\n\nLiteLLM recommends upgrading to `1.83.7-stable` or later.\n\n### Workarounds\nIf upgrading is not immediately possible:\n\n1. Block `POST /prompts/test` at your reverse proxy or API gateway.\n2. Review and rotate API keys that should not have access to prompt management routes." affected: - package: name: litellm ecosystem: PyPI purl: pkg:pypi/litellm ranges: - type: ECOSYSTEM events: - introduced: 1.80.5 - fixed: 1.83.7 versions: - 1.80.10 - 1.80.11 - 1.80.12 - 1.80.13 - 1.80.15 - 1.80.16 - 1.80.17 - 1.80.5 - 1.80.6 - 1.80.7 - 1.80.8 - 1.80.9 - 1.81.0 - 1.81.1 - 1.81.10 - 1.81.11 - 1.81.12 - 1.81.13 - 1.81.14 - 1.81.15 - 1.81.16 - 1.81.3 - 1.81.4 - 1.81.5 - 1.81.6 - 1.81.7 - 1.81.8 - 1.81.9 - 1.81.9.dev1 - 1.82.0 - 1.82.1 - 1.82.2 - 1.82.3 - 1.82.4 - 1.82.5 - 1.82.6 - 1.83.0 - 1.83.1 - 1.83.2 - 1.83.3 - 1.83.4 - 1.83.5 - 1.83.6 references: - type: WEB url: https://github.com/BerriAI/litellm/security/advisories/GHSA-xqmj-j6mv-4862 - type: ADVISORY url: https://nvd.nist.gov/vuln/detail/CVE-2026-42203 - type: PACKAGE url: https://github.com/BerriAI/litellm - type: WEB url: https://github.com/BerriAI/litellm/releases/tag/v1.83.7-stable - type: PACKAGE url: https://pypi.org/project/litellm - type: ADVISORY url: https://github.com/advisories/GHSA-xqmj-j6mv-4862 severity: - type: CVSS_V4 score: 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