# LiteLLM: Server-Side Template Injection in /prompts/test endpoint

Advisory record · `GHSA-xqmj-j6mv-4862`

- **Identifiers:** `GHSA-xqmj-j6mv-4862` · `CVE-2026-42203` · `PYSEC-2026-2602`
- **State:** Confirmed
- **Severity:** CVSS 8.6 High
- **Critical:** No
- **Weakness (CWE):** [CWE-94](https://cwe.mitre.org/data/definitions/94.html) · [CWE-1336](https://cwe.mitre.org/data/definitions/1336.html)
- **Tags:** [Code injection](https://agentprime.io/advisories/tag/code-injection.md)
- **Published:** 24 Apr 2026
- **Updated:** 10 Sept 2026
- **Reviewed by a person:** No

Published by the GitHub Advisory Database at 24 Apr 2026, 16:02 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

## Affected packages

- `litellm` (PyPI): affected `>=1.80.5, <1.83.7`; fixed in `1.83.7`

## Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

> LiteLLM versions >=1.80.5 and <1.83.7 are affected by a server-side template injection in the POST /prompts/test endpoint, which renders user-supplied prompt templates without sandboxing. Any user with a valid proxy API key can reach it and potentially run arbitrary code in the proxy process, exposing environment secrets and possibly commands on the host. Upgrade to 1.83.7 or later; until then, block that endpoint at your reverse proxy or API gateway and rotate keys that should not access prompt routes.

Written 5 Nov 2026.

## Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

## Severity and exploitation

- 8.6 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`, from CNA (GitHub_M)

- **CISA KEV:** Not listed.
- **EPSS:** 0.0037, the 31st percentile, on 14 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

- 31 Oct 2026, 14:34 UTC: First seen by agentprime
- 31 Oct 2026, 14:34 UTC: [Confirmed by OSV](https://osv.dev/vulnerability/GHSA-xqmj-j6mv-4862)

## Sources

- [GitHub Advisory Database: GHSA-xqmj-j6mv-4862](https://github.com/advisories/GHSA-xqmj-j6mv-4862)
- [OSV: GHSA-xqmj-j6mv-4862](https://osv.dev/vulnerability/GHSA-xqmj-j6mv-4862)
- <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>

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.

## Check whether this affects you

A Match means an installed version is in the affected range above. Most don’t affect the app; agentprime hasn’t analysed this one yet.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), ask your agent to check the project: `check_lockfile` sends a lockfile, `check_packages` a list of installed packages, and both return the Matches and the upgrades that clear them. `get_advisory` returns this record. Setup: <https://agentprime.io/mcp.md>
- In a browser: <https://agentprime.io/check/> reads your lockfile in the browser, never uploading it.
- Whether it touches your code, with file and line: the Claude Code plugin, <https://agentprime.io/plugin.md>
- As JSON: <https://api.agentprime.io/v1/advisories/GHSA-xqmj-j6mv-4862>, or `POST https://api.agentprime.io/v1/match` with your packages (<https://agentprime.io/api.md>)

---

The web page: <https://agentprime.io/advisories/GHSA-xqmj-j6mv-4862/>. Everything for agents: <https://agentprime.io/llms.txt>.
