---
id: CVE-2026-42203
aliases:
  - GHSA-xqmj-j6mv-4862
  - PYSEC-2026-2602
title: 'LiteLLM: Server-Side Template Injection in /prompts/test endpoint'
summary: 'LiteLLM: Server-Side Template Injection in /prompts/test endpoint'
severity: high
vendor: litellm
product: litellm
ecosystem: pip
affected:
  - 'litellm >= 1.80.5, < 1.83.7'
patched:
  - litellm 1.83.7
published: '2026-04-24'
updated: '2026-09-10'
sourceUpdated: '2026-09-10T03:50:45.007056853Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-xqmj-j6mv-4862'
references:
  - url: 'https://github.com/BerriAI/litellm/security/advisories/GHSA-xqmj-j6mv-4862'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-42203'
  - url: 'https://github.com/BerriAI/litellm'
  - url: 'https://github.com/BerriAI/litellm/releases/tag/v1.83.7-stable'
tags:
  - osv
  - pip
  - exploit-available
epss: 0.00664
epssPercentile: 0.49745
exploits:
  github: 1
  githubRepos:
    - 'https://github.com/Astianjy/CVE-2026-42203'
  checkedAt: '2026-09-28T12:09:52.170Z'
exploitAvailable: true
ingestedAt: '2026-07-13T18:58:05.296Z'
---

## Overview

### 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.

## Affected packages

- `litellm >= 1.80.5, < 1.83.7`

## Remediation

Upgrade to a patched release:

- `litellm 1.83.7`
