CVE-2024-2952
Server-Side Template Injection in BerriAI/litellm
CRITICAL 9.8
At a glance
- Source
- NVD
- EPSS
- EPSS 1.27 % · percentile 70 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- @huntr_ai
- NVD status
- Analyzed
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.
Weaknesses (CWE)
- CWE-76 — Improper Neutralization of Equivalent Special Elements
References
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.0 | CRITICAL 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | @huntr_ai |
| CVSS 3.0 | CRITICAL 9.8 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NVD · security@huntr.dev (Secondary) |
Advisories
- GHSA-46cm-pfwv-cgf8 — LiteLLM has Server-Side Template Injection vulnerability in /completions endpoint
- PYSEC-2026-387 — LiteLLM has Server-Side Template Injection vulnerability in /completions endpoint
European references
- ENISA EUVD · EUVD-2024-1088
- GCVE · GCVE-0-2024-2952
Affected configurations (NVD CPE)
cpe:2.3:a:litellm:litellm:*:*:*:*:*:*:*:*< 1.34.42
Affected products
| Product | Versions |
|---|---|
| berriai · berriai/litellm | affected unspecified < 1.34.42 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |