LiteLLM has Server-Side Template Injection vulnerability in /completions endpoint
Published 10 Apr 2024 · Updated 10 Sept 2026
Is your project on an affected litellm?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <1.34.42
- Fixed in
- 1.34.42
pip install 'litellm>=1.34.42'Details
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.
Is GHSA-46cm-pfwv-cgf8 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected litellm, and gives you the command that fixes it.
More advisories for litellm
- HighGHSA-g5ff-637f-6q2mLiteLLM: internal_user_viewer arbitrary local file read via `vertex_ai_credentials` · 27 Oct 2026
- MediumGHSA-hhww-mrg2-969hLiteLLM vulnerable to reflected XSS in /sso/debug/callback · 27 Oct 2026
- HighCVE-2026-114612LiteLLM: Privilege Escalation to Proxy Admin via Cross-Domain Reuse of the Salt Key · 27 Oct 2026
- MediumCVE-2026-84377LiteLLM: Authenticated SSRF and provider-credential exfiltration via unvalidated request-body routing parameters · 30 Sept 2026
- MediumCVE-2026-59823LiteLLM Proxy has server-side request forgery via the `user_config` request parameter · 17 Sept 2026
- CriticalCVE-2026-37004LiteLLM vulnerable to server-side template injection in the /prompts/test endpoint · 27 Aug 2026
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2024-2952
- Linkgithub.com/BerriAI/litellm/issues/2949
- Linkgithub.com/BerriAI/litellm/pull/2941
- Linkgithub.com/BerriAI/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3
- Packagegithub.com/BerriAI/litellm
- Linkgithub.com/BerriAI/litellm/blob/0d803e13798db40aa7463e64a6bafaee386424f5/litellm/proxy/proxy_server.py#L2087
- Advisorygithub.com/advisories/GHSA-46cm-pfwv-cgf8
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/litellm/PYSEC-2026-387.yaml
- Linkhuntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4
- Linkpypi.org/project/litellm
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.