CVE-2024-2952 json
Server-Side Template Injection in BerriAI/litellm
published 2024-04-10 2 y ago modified 2026-09-10 1 mo ago also GHSA-46cm-pfwv-cgf8 , PYSEC-2026-387 , EUVD-2024-1088
- cvss
- 9.8
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.3%
- EPSS 1.3% chance of exploitation in 30 days, percentile 69%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi litellm 1.34.42
- berriai berriai/litellm 1.34.42
- berriai litellm 1.34.42
- github.com/berriai/litellm@8a1cdc9 commit
- github.com/BerriAI/litellm#2941 pull request
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
1.27% chance of exploitation in the next 30 days, higher than 69% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- huntr.com https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | 3.0 | 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.0 | 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | litellm | <1.34.42 |
1.34.42 |
Affected products
- berriai berriai/litellm
- berriai litellm
Classification
- Weakness
-
- CWE-76 Improper Neutralization of Equivalent Special Elements
References
-
github.com
/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3
patch
-
github.com
/BerriAI/litellm/pull/2941
web
-
github.com
/BerriAI/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3
web
-
huntr.com
/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4
web, exploit, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2024-2952
advisory
-
github.com
/BerriAI/litellm/issues/2949
web
-
github.com
/BerriAI/litellm
package
-
github.com
/BerriAI/litellm/blob/0d803e13798db40aa7463e64a6bafaee386424f5/litellm/proxy/proxy_server.py#L2087
web
-
github.com
/advisories/GHSA-46cm-pfwv-cgf8
advisory
-
github.com
/pypa/advisory-database/tree/main/vulns/litellm/PYSEC-2026-387.yaml
web
-
pypi.org
/project/litellm
web, package
Sources
- CVE List CVE-2024-2952
- GitHub Advisory GHSA-46cm-pfwv-cgf8
- NVD CVE-2024-2952
- OSV PYSEC-2026-387
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.