Improper Neutralization of Special Elements Used in a Template Engine Affecting litellm package, versions [1.80.5,1.83.7)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-LITELLM-16300055
  • published26 Apr 2026
  • disclosed24 Apr 2026
  • creditUnknown

Introduced: 24 Apr 2026

NewCVE-2026-42203  (opens in a new tab)
CWE-1336  (opens in a new tab)

How to fix?

Upgrade litellm to version 1.83.7 or higher.

Overview

litellm is a Library to easily interface with LLM API providers

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements Used in a Template Engine via the POST /prompts/test endpoint, which accepts user-supplied prompt templates and renders them without sandboxing. An attacker can execute arbitrary code within the server process by submitting a crafted template after authenticating with a valid proxy API key. This may expose sensitive environment variables or allow commands to be executed on the host.

Workaround

  • This vulnerability can be mitigated by blocking POST /prompts/test at your reverse proxy or API gateway, and by reviewing and rotating API keys that should not have access to prompt management routes.

CVSS Base Scores

version 4.0
version 3.1