Skip to content
9.8 Critical

CVE-2024-2952 BerriAI/litellm is vulnerable to Server-Side Template Injection (SSTI) via the `/completions` endpoint

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.

Affected products and versions

Product Affected versions Fixed in
litellm 1.23 1.23.2 → < 1.34.42 1.34.42
berriai/litellm 1.34 earliest → < 1.34.42 1.34.42

References

Timeline

  1. Published
  2. Last modified
The 40 CVEs of litellm →
Track this CVE