Critical severity · published Apr 10, 2024
CVE-2024-2952
Server-Side Template Injection in BerriAI/litellm
9.8
CVSS
1.3%
EPSS
No
On KEV
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.
CVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)1.3% · higher than 70% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
BE
berriai/litellm · berriai
before 1.34.42 · source: vendor
LI
Litellm · Litellm
before 1.34.42 · source: NVD, CISA
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2024-2952
CVE.org
https://www.cve.org/CVERecord?id=CVE-2024-2952
Patch
https://github.com/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3
Exploit
https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4
More from berriai/litellm
9.8
CVE-2024-5751
Remote Code Execution in BerriAI/litellm
9.8
CVE-2024-4264
Remote Code Execution in berriai/litellm
8.8
CVE-2024-6825
Remote Code Execution in BerriAI/litellm
8.1
CVE-2025-0628
Improper Authorization in BerriAI/litellm
8.1
CVE-2024-4888
Arbitrary File Deletion in BerriAI/litellm
