berriai/litellm: Improper Neutralization of Equivalent Special Elements
CVE-2024-2952 is a critical-severity improper neutralization of equivalent special elements vulnerability in berriai/litellm from BerriAI, with a CVSS 3.0 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 1.34.42 as the first without the flaw, so updating berriai/litellm to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 1.27% chance of exploitation within 30 days, higher than 70% of scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Update berriai/litellm to 1.34.42 or a later version.
- Update litellm to 1.34.42 or a later version.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Berriai | berriai/litellm | before 1.34.42 | 1.34.42 |
| Berriai | litellm | 1.23.2 up to, but not including, 1.34.42 | 1.34.42 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by CNA (huntr.dev).
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Neutralization of Equivalent Special Elements
The product correctly neutralizes certain special elements, but it improperly neutralizes equivalent special elements.
How developers prevent this class of flaw
- Programming languages and supporting technologies might be chosen which are not subject to these issues.
- Utilize an appropriate mix of allowlist and denylist parsing to filter equivalent special element syntax from all input.
More Improper Neutralization of Equivalent Special Elements vulnerabilities (CWE-76)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: yes, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
Technical write-ups (may include proof of concept)
- huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4Exploit, Third Party Advisory
Other vulnerabilities in berriai/litellm
- 8.1 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 8.8 High severity
- 7.5 High severity
Recent Improper Neutralization of Equivalent Special Elements vulnerabilities
- 7.2 High severity
Spotted an error? Tell us.