{"id":"CVE-2024-2952","state":"PUBLISHED","title":"Server-Side Template Injection in BerriAI/litellm","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.","publishedAt":"2024-04-10T17:07:52.935Z","updatedAt":"2024-08-01T19:32:42.587Z","severity":{"score":9.8,"label":"Critical","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"@huntr_ai"},"assigner":"@huntr_ai","products":["berriai berriai/litellm"],"affected":[{"vendor":"berriai","product":"berriai/litellm","versions":[{"version":"unspecified","status":"affected","lessThan":"1.34.42","versionType":"custom"}]}],"references":["https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4","https://github.com/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3"],"weaknesses":["CWE-76"],"ingestedAt":"2026-10-29T20:07:21.467Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/2xxx/CVE-2024-2952.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-2952","state":"PUBLISHED","datePublished":"2024-04-10T17:07:52.935Z","dateUpdated":"2024-08-01T19:32:42.587Z","assignerShortName":"@huntr_ai","assignerOrgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateReserved":"2024-03-26T18:00:46.844Z"},"containers":{"cna":{"title":"Server-Side Template Injection in BerriAI/litellm","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"berriai","product":"berriai/litellm","versions":[{"version":"unspecified","status":"affected","lessThan":"1.34.42","versionType":"custom"}]}],"references":[{"url":"https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4"},{"url":"https://github.com/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3"}],"metrics":[{"cvssV3_0":{"version":"3.0","attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"HIGH","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-76","type":"CWE","lang":"en","description":"CWE-76 Improper Neutralization of Equivalent Special Elements"}]}],"providerMetadata":{"shortName":"@huntr_ai","orgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateUpdated":"2024-04-16T11:10:21.535Z"},"source":{"advisory":"a9e0a164-6de0-43a4-a640-0cbfb54220a4","discovery":"EXTERNAL"}},"adp":[{"title":"CISA ADP Vulnrichment","affected":[{"vendor":"berriai","product":"litellm","defaultStatus":"unknown","versions":[{"version":"1.23.2","status":"affected","lessThan":"1.34.42","versionType":"custom"}],"cpes":["cpe:2.3:a:berriai:litellm:*:*:*:*:*:*:*:*"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-07-03T15:32:17.112100Z","id":"CVE-2024-2952","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-07-03T16:51:12.428Z"}},{"title":"CVE Program Container","references":[{"url":"https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4","tags":["x_transferred"]},{"url":"https://github.com/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-01T19:32:42.587Z"}}]}}}