{"id":"CVE-2024-2952","published":"2024-04-10T17:07:52Z","modified":"2024-08-01T19:32:42Z","title":"Server-Side Template Injection in BerriAI/litellm","vendor":"berriai","product":"berriai/litellm","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01267,"percentile":0.70471,"provenance":"source"},"cwes":[{"id":"CWE-76","name":"Improper Neutralization of Equivalent Special Elements"}],"references":[{"url":"https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4","tags":[]},{"url":"https://github.com/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3","tags":[]}],"priority":{"score":21.0,"factors":[{"name":"EPSS percentile","points":14.09},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"berriai","affectedVersions":[{"vendor":"berriai","product":"berriai/litellm","versions":[">= unspecified, < 1.34.42"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2024-07-03T15:32:17.112100Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"litellm","vulnerableRanges":["<1.34.42"],"patched":["1.34.42"],"from":["GHSA-46cm-pfwv-cgf8","PYSEC-2026-387"],"provenance":"source"}],"summary":{"text":"A Server-Side Template Injection flaw exists in the berriai/litellm product, specifically in the hf_chat_template method, which passes the chat_template parameter from tokenizer_config.json to the Jinja template engine without proper sanitization, and this is reachable through the /completions endpoint. An attacker who can supply a crafted tokenizer_config.json file can execute arbitrary code on the server, and the attack requires only network access to the endpoint, with no authentication or user interaction needed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:03:29Z"},"euvd":{"id":"EUVD-2024-1088","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-2952","published":"2024-04-10","fixed":"1.34.42","kev":false},{"cve":"CVE-2024-4888","published":"2024-06-06","fixed":"1.35.36","kev":false,"link":{"from":"CVE-2024-2952","to":"CVE-2024-4888","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:litellm","fromFixed":"1.34.42","toFixed":"1.35.36","daysApart":57}]}},{"cve":"CVE-2024-5225","published":"2024-06-06","fixed":"1.40.0","kev":false},{"cve":"CVE-2024-5710","published":"2024-06-27","fixed":"1.40.15","kev":false}],"package":"PyPI:litellm"}}