berriai litellm Jinja Template tokenizer_config.json hf_chat_template equivalent special elements
| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 8.4 | $0-$5k | 0.00 |
Summary
A vulnerability, which was classified as critical, has been found in berriai litellm. The affected element is the function hf_chat_template of the file tokenizer_config.json of the component Jinja Template Handler. This manipulation of the argument chat_template causes improper neutralization of equivalent special elements.
This vulnerability appears as CVE-2024-2952. The attack may be initiated remotely. There is no available exploit.
Details
A vulnerability was found in berriai litellm (affected version unknown). It has been declared as critical. Affected by this vulnerability is the function hf_chat_template of the file tokenizer_config.json of the component Jinja Template Handler. The manipulation of the argument chat_template with an unknown input leads to a improper neutralization of equivalent special elements vulnerability. The CWE definition for the vulnerability is CWE-76. The product correctly neutralizes certain special elements, but it improperly neutralizes equivalent special elements. As an impact it is known to affect confidentiality, integrity, and availability. The summary by CVE is:
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.
The advisory is shared at huntr.com. This vulnerability is known as CVE-2024-2952 since 03/26/2024. The exploitation appears to be easy. The attack can be launched remotely. The exploitation doesn't need any form of authentication. Technical details are known, but no exploit is available.
By approaching the search of inurl:tokenizer_config.json it is possible to find vulnerable targets with Google Hacking.
There is no information about possible countermeasures known. It may be suggested to replace the affected object with an alternative product.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Product
Vendor
Name
License
Website
- Product: https://github.com/berriai/litellm/
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔍VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 8.5VulDB Meta Temp Score: 8.4
VulDB Base Score: 7.3
VulDB Temp Score: 7.0
VulDB Vector: 🔍
VulDB Reliability: 🔍
CNA Base Score: 9.8
CNA Vector (huntr.dev): 🔍
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍
Exploiting
Class: Improper neutralization of equivalent special elementsCWE: CWE-76 / CWE-707 / CWE-20
CAPEC: 🔍
ATT&CK: 🔍
Physical: No
Local: No
Remote: Yes
Availability: 🔍
Status: Not defined
Google Hack: 🔍
EPSS Score: 🔍
EPSS Percentile: 🔍
Price Prediction: 🔍
Current Price Estimation: 🔍
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: no mitigation knownStatus: 🔍
0-Day Time: 🔍
Patch: github.com
Timeline
03/26/2024 🔍04/10/2024 🔍
04/10/2024 🔍
07/15/2025 🔍
Sources
Product: github.comAdvisory: 8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3
Status: Confirmed
CVE: CVE-2024-2952 (🔍)
GCVE (CVE): GCVE-0-2024-2952
GCVE (VulDB): GCVE-100-260233
Entry
Created: 04/10/2024 19:31Updated: 07/15/2025 18:48
Changes: 04/10/2024 19:31 (63), 05/16/2024 08:05 (2), 07/15/2025 18:48 (7)
Complete: 🔍
Cache ID: 216::103
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
No comments yet. Languages: en.
Please log in to comment.