{"schemaVersion":3,"id":"CVE-2024-2952","aliases":["GHSA-46cm-pfwv-cgf8","PYSEC-2026-387"],"status":"published","duplicateOf":null,"title":null,"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.","dates":{"published":"2024-04-10T17:07:52.935Z","modified":"2024-08-01T19:32:42.587Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":9.8,"severity":"critical","version":"3.0","versionLabel":"v3.0","source":"CVE.org","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.0","versionLabel":"v3.0","source":"CVE.org","score":9.8,"severity":"critical","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"3.0","versionLabel":"v3.0","source":"OSV · Pypi","score":9.8,"severity":"critical","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","exploitability":10,"impact":9.8,"computed":true},{"version":"3.0","versionLabel":"v3.0","source":"NVD","score":9.8,"severity":"critical","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.01267,"percentile":0.69363,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.01267},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.01267,"percentile":0.69363}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.01267,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.01267,"percentile":0.69363}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"REF_1DAF7221CEE96645","name":"Exploit Reference (huntr.com)","source":"reference","url":"https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4","maturity":"unknown","reliabilityScore":0.2,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-76","name":"Improper Neutralization of Equivalent Special Elements","description":"The product correctly neutralizes certain special elements, but it improperly neutralizes equivalent special elements.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/76.html"}],"affected":[{"vendor":"berriai","product":"berriai/litellm","name":"berriai/litellm","label":"berriai/litellm","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ unspecified, < 1.34.42","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ unspecified, < 1.34.42","eol":null,"hubHref":"/vendor/berriai/berriailitellm"},{"vendor":"litellm","product":"litellm","name":"litellm","label":"litellm","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 1.34.42","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.34.42","eol":null,"hubHref":"/vendor/litellm/litellm"},{"vendor":"PyPI","product":"litellm","name":"litellm","label":"litellm","ecosystem":"PyPI","cpePart":null,"purl":"pkg:pypi/litellm","purlType":"pypi","versions":[{"text":"< 1.34.42","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.34.42","eol":null,"hubHref":null}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4","label":"huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4","hostname":"huntr.com","tags":["WEB","Exploit","Third Party Advisory"]},{"url":"https://github.com/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3","label":"github.com/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3","hostname":"github.com","tags":["Patch"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-2952","label":"nvd.nist.gov/vuln/detail/CVE-2024-2952","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/BerriAI/litellm/issues/2949","label":"github.com/BerriAI/litellm/issues/2949","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/BerriAI/litellm/pull/2941","label":"github.com/BerriAI/litellm/pull/2941","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/BerriAI/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3","label":"github.com/BerriAI/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/BerriAI/litellm","label":"github.com/BerriAI/litellm","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/BerriAI/litellm/blob/0d803e13798db40aa7463e64a6bafaee386424f5/litellm/proxy/proxy_server.py#L2087","label":"github.com/BerriAI/…","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/advisories/GHSA-46cm-pfwv-cgf8","label":"github.com/advisories/GHSA-46cm-pfwv-cgf8","hostname":"github.com","tags":["Advisory"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/litellm/PYSEC-2026-387.yaml","label":"github.com/pypa/advisory-database/tree/main/vulns/litellm/PYSEC-2026-387.yaml","hostname":"github.com","tags":["WEB"]},{"url":"https://pypi.org/project/litellm","label":"pypi.org/project/litellm","hostname":"pypi.org","tags":["WEB","PACKAGE"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2024-04-10T17:07:52.935Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-01T19:32:42.587Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":70,"level":"high","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T19:30:06.703Z","stale":false,"partial":false}}