Skip to content
LiteLLMGHSA-46cm-pfwv-cgf8

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

Critical9.8CVE-2024-2952 · Published Apr 10, 2024 · updated Sep 10, 2026

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.

GitHub advisory

Affected versions

PackageAffectedFixed in
litellm
PyPI
< 1.34.421.34.42
Details and references

More LiteLLM advisories

All LiteLLM
Advisory
litellm vulnerable to improper access control in team management
Medium5.3Jun 27, 2024
litellm vulnerable to remote code execution based on using eval unsafely
Critical9.8Jun 27, 2024
SQL injection in litellm
Medium6.4Jun 6, 2024
SQL injection in litellm
Medium4.9Jun 6, 2024
Arbitrary file deletion in litellm
High6.5Jun 6, 2024
litellm passes untrusted data to `eval` function without sanitization
High7.2May 18, 2024

Critical advisories by email

Wednesdays: the week’s critical and high advisories in the AI and data stack, with the fixed versions. Only in weeks that have some.

Double opt-in. Unsubscribe any time.