CVE-2024-2952: LiteLLM Has Server-Side Template Injection Vulnerability
Affects litellmSource GCVE Database
Not known to be exploited · CVSS 9.8 Critical : upgrade to 1.34.42 as a priority.
Data as of 3 Nov 2026, 22:57 UTC
- EPSS
- 1.2% chance of exploitation in 30 days – higher than 69% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 1.34.42
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 10 Apr 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 3 Nov 2026.
What to do
Upgrade litellm to 1.34.42.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIlitellm | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available in LiteLLM version 1.34.42 and later. Users should upgrade to version 1.34.42 or newer to remediate this vulnerability. Since this is not a cloud service, remediation requires applying the update to affected installations. Patch status is confirmed by the affectedVersions field indicating versions <1.34.42 are vulnerable and fixed in 1.34.42.
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.
References
- nvd.nist.gov/vuln/detail/CVE-2024-2952 (opens in a new tab)
- github.com/BerriAI/litellm/issues/2949 (opens in a new tab)
- github.com/BerriAI/litellm/pull/2941 (opens in a new tab)
- github.com/BerriAI/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3 (opens in a new tab)
- github.com/BerriAI/litellm (opens in a new tab)
- github.com/BerriAI/litellm/blob/0d803e13798db40aa7463e64a6bafaee386424f5/litellm/proxy/proxy_server.py (opens in a new tab)
- github.com/advisories/GHSA-46cm-pfwv-cgf8 (opens in a new tab)
- github.com/pypa/advisory-database/tree/main/vulns/litellm/PYSEC-2026-387.yaml (opens in a new tab)
- huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4 (opens in a new tab)
- pypi.org/project/litellm (opens in a new tab)