GHSA-46cm-pfwv-cgf8: LiteLLM has Server-Side Template Injection vulnerability in /completions endpoint
LiteLLM versions prior to 1.34.42 contain a Server-Side Template Injection (SSTI) vulnerability in the /completions endpoint. The vulnerability occurs because the hf_chat_template method processes the chat_template parameter from the tokenizer_config.json file using the Jinja template engine without proper sanitization. This allows attackers to craft malicious tokenizer_config.json files that can execute arbitrary code on the server. The vulnerability is classified as critical due to its potential to compromise confidentiality, integrity, and availability.
AI Analysis
Technical Summary
LiteLLM (BerriAI/litellm) is affected by a Server-Side Template Injection vulnerability (CVE-2024-2952) in the /completions endpoint. The issue stems from the hf_chat_template method processing the chat_template parameter from tokenizer_config.json through the Jinja template engine without adequate sanitization. This flaw enables attackers to execute arbitrary code on the server by supplying maliciously crafted tokenizer_config.json files. The vulnerability affects all versions prior to 1.34.42 and has a CVSS 3.0 base score indicating critical severity with network attack vector, low attack complexity, no privileges required, no user interaction, and full impact on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation of this vulnerability allows remote attackers to execute arbitrary code on the server hosting LiteLLM by sending specially crafted tokenizer_config.json files. This compromises the confidentiality, integrity, and availability of the affected system, potentially leading to full system compromise.
Mitigation Recommendations
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.
GHSA-46cm-pfwv-cgf8: LiteLLM has Server-Side Template Injection vulnerability in /completions endpoint
Description
LiteLLM versions prior to 1.34.42 contain a Server-Side Template Injection (SSTI) vulnerability in the /completions endpoint. The vulnerability occurs because the hf_chat_template method processes the chat_template parameter from the tokenizer_config.json file using the Jinja template engine without proper sanitization. This allows attackers to craft malicious tokenizer_config.json files that can execute arbitrary code on the server. The vulnerability is classified as critical due to its potential to compromise confidentiality, integrity, and availability.
CVSS v3.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
LiteLLM (BerriAI/litellm) is affected by a Server-Side Template Injection vulnerability (CVE-2024-2952) in the /completions endpoint. The issue stems from the hf_chat_template method processing the chat_template parameter from tokenizer_config.json through the Jinja template engine without adequate sanitization. This flaw enables attackers to execute arbitrary code on the server by supplying maliciously crafted tokenizer_config.json files. The vulnerability affects all versions prior to 1.34.42 and has a CVSS 3.0 base score indicating critical severity with network attack vector, low attack complexity, no privileges required, no user interaction, and full impact on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation of this vulnerability allows remote attackers to execute arbitrary code on the server hosting LiteLLM by sending specially crafted tokenizer_config.json files. This compromises the confidentiality, integrity, and availability of the affected system, potentially leading to full system compromise.
Mitigation Recommendations
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.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-46cm-pfwv-cgf8
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2024-2952"]
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.0
Threat ID: 6a4c345d27e9c797195ffcb5
Added to database: 07/06/2026, 23:03:57 UTC
Last enriched: 07/06/2026, 23:36:19 UTC
Last updated: 07/06/2026, 23:36:19 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.