Server-Side Template Injection in BerriAI/litellm
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.0 · CNA. Fix status from CNA and GitHub.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| BerriAI | berriai/litellm | before 1.34.42 | 1.34.42 | Patch available | CNA |
| — | litellm (PyPI) | before 1.34.42 | 1.34.42 | Patch available | GHSA-46cm-pfwv-cgf8 |
- berriai/litellm VendorBerriAI Affected before 1.34.42 Fixed in 1.34.42 Patch available CNA
- litellm (PyPI) Vendor— Affected before 1.34.42 Fixed in 1.34.42 Patch available GHSA-46cm-pfwv-cgf8
Remediation
- Fix · CNA berriai/litellm (berriai) Fixed in 1.34.42
- Fix · GHSA-46cm-pfwv-cgf8 litellm (PyPI) Fixed in 1.34.42 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-2952
- 2026-10-03 Alias added: GHSA-46cm-pfwv-cgf8
References
Advisory 2
Other 7
- https://github.com/BerriAI/litellm/issues/2949
- https://github.com/BerriAI/litellm/pull/2941
- https://github.com/BerriAI/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3
- https://github.com/BerriAI/litellm
- https://github.com/BerriAI/litellm/blob/0d803e13798db40aa7463e64a6bafaee386424f5/litellm/proxy/proxy_server.py#L2087
- https://github.com/pypa/advisory-database/tree/main/vulns/litellm/PYSEC-2026-387.yaml
- https://pypi.org/project/litellm
More BerriAI Litellm vulnerabilities
- TI-2026-26015 Trivy ecosystem supply chain briefly compromised KEVCVSS 4.0CRITICAL 9.4
- TI-2026-30529 LiteLLM: SQL injection in Proxy API key verification KEVCVSS 4.0CRITICAL 9.3
- TI-2026-30582 LiteLLM: Authenticated command execution via MCP stdio test endpoints KEVCVSS 4.0HIGH 8.7
- TI-2026-42639 LiteLLM: MCP Authentication Bypass via OAuth2 Passthrough Fallback KEVCVSS 4.0HIGH 8.8
- TI-2024-05340 Remote Code Execution in BerriAI/litellm CVSS 3.1CRITICAL 9.8
- TI-2026-34701 LiteLLM < 1.83.10 Privilege Escalation via User Update CVSS 4.0HIGH 8.7
Sources
- CVE-2024-2952 · CVE Program
- CVE-2024-2952 · NVD
- FIRST EPSS
- GHSA-46cm-pfwv-cgf8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences