Arbitrary Code Injection Affecting litellm package, versions [,1.85.0)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.8% (55th percentile)

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 Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-LITELLM-19477048
  • published1 Sept 2026
  • disclosed31 Aug 2026
  • creditYeran Gamage

Introduced: 31 Aug 2026

CVE-2026-37004  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade litellm to version 1.85.0 or higher.

Overview

litellm is a Library to easily interface with LLM API providers

Affected versions of this package are vulnerable to Arbitrary Code Injection in the /prompts/test endpoint through the rendered_content path in litellm/proxy/prompts/prompt_endpoints.py. An attacker can execute arbitrary OS commands by sending a crafted dotprompt_content parameter rendered in an unsandboxed Jinja2 environment. This lets an unauthenticated remote requester turn template expression traversal into code execution on the proxy host, putting the LiteLLM server and any data it handles at risk.

Notes:

  • According to de28a4f, while DotpromptManager was hardened to render through ImmutableSandboxedEnvironment in 1.82.5, the three sibling managers (gitlab, arize, bitbucket) were missed and still instantiate plain jinja2.Environment()

CVSS Base Scores

version 4.0
version 3.1