CVE-2024-2952: Server-Side Template Injection in BerriAI/litellm
Vulnerability summary
CVE-2024-2952 is a critical (CVSS 9.8) vulnerability in berriai berriai/litellm. EPSS estimates a 1.26% chance of exploitation in the next 30 days, higher than 70.5% of scored vulnerabilities. 1 public exploit is recorded.
Public exploit (reference, Date unknown)
Source freshness unavailable
How is this decided?Timeline
- 10-04-2024PublishedVulnerability first disclosed.
- 01-08-2024Last modifiedVulnerability information updated.
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 metrics
3 scores · 3 sources · 1 version- OSV · PypiEcosystem advisory · calculated9.8CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- NVDNIST9.8CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
1.26%
Chance of exploitation in the next 30 days
Percentile
71%
Versus all other CVEs
30-day change
Decrease -0.01 pp
From 1.27% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundExploit Reference (huntr.com)
Maturity: unknown
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Berriai1 product
- berriai/litellm≥ unspecified, < 1.34.42
Litellm1 product
- litellm< 1.34.42
PyPI1 product
- litellm< 1.34.42
3 vendors · 3 products
References
11 links- github.com/BerriAI/litellmPACKAGE