All reports
Critical

LiteLLM has Server-Side Template Injection vulnerability in /completions endpoint

Affected versions

Version ranges need review.

Affected versions
< 1.34.42
Fixed version
1.34.42
Affected versions
<1.34.42
Fixed version
1.34.42

Exploitation

CVE-2024-2952

Probability of exploitation in the next 30 days: 1.27%

FIRST EPSS · 2026-11-21

Description

BerriAI/litellm is vulnerable to Server-Side Template Injection (SSTI) via the /completions endpoint. The vulnerability arises from the hf_chat_template method processing the chat_template parameter from the tokenizer_config.json file through the Jinja template engine without proper sanitization. Attackers can exploit this by crafting malicious tokenizer_config.json files that execute arbitrary code on the server.

Links

Credits

  • ishaan-jaff
  • r3kumar
  • cookesan