{"id":"CVE-2024-2952","aliases":["CVE-2024-2952","GHSA-46cm-pfwv-cgf8","PYSEC-2026-387"],"related":[],"kind":"vulnerability","state":"published","title":"Server-Side Template Injection in BerriAI/litellm","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"es","text":"BerriAI/litellm es vulnerable a Server-Side Template Injection (SSTI) a través del endpoint `/completions`. La vulnerabilidad surge del método `hf_chat_template` que procesa el parámetro `chat_template` del archivo `tokenizer_config.json` a través del motor de plantillas Jinja sin una sanitización adecuada. Los atacantes pueden aprovechar esto creando archivos maliciosos `tokenizer_config.json` que ejecutan código arbitrario en el servidor.","source":"nvd"}],"published":"2024-04-10T17:07:52.935Z","modified":"2026-09-10T03:50:11.252Z","severity":{"scorer":"@huntr_ai","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"@huntr_ai","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-76"],"affected":[{"ranges":[{"type":"custom","introduced":"unspecified","fixed":"1.34.42","status":"affected"}],"vendor":"berriai","product":"berriai/litellm","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"1.23.2","fixed":"1.34.42","status":"affected"}],"vendor":"berriai","product":"litellm","cpe":"cpe:2.3:a:berriai:litellm:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.34.42"}],"ecosystem":"PyPI","package":"litellm","purl":"pkg:pypi/litellm","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.34.42"}],"vendor":"litellm","product":"litellm","cpe":"cpe:2.3:a:litellm:litellm:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.34.42"}],"ecosystem":"PyPI","package":"litellm","purl":"pkg:pypi/litellm","source":"pysec"}],"references":[{"url":"https://huntr.com/bounties/a9e0a164-6de0-43a4-a640-0cbfb54220a4","tags":["exploit","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/berriai/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-2952","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/BerriAI/litellm/issues/2949","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/BerriAI/litellm/pull/2941","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/BerriAI/litellm/commit/8a1cdc901708b07b7ff4eca20f9cb0f1f0e8d0b3","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/BerriAI/litellm","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/BerriAI/litellm/blob/0d803e13798db40aa7463e64a6bafaee386424f5/litellm/proxy/proxy_server.py#L2087","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/advisories/GHSA-46cm-pfwv-cgf8","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/litellm/PYSEC-2026-387.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://pypi.org/project/litellm","tags":["package","web"],"sources":["ghsa","pysec"]}],"credits":[],"assigner":"@huntr_ai","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2024-07-03T15:32:17.112Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-2952","url":"https://www.cve.org/CVERecord?id=CVE-2024-2952","licence":"CVE Terms of Use","modified":"2024-08-01T19:32:42.587Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-46cm-pfwv-cgf8","url":"https://github.com/advisories/GHSA-46cm-pfwv-cgf8","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:11.252Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-2952","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-2952","licence":"Public domain","modified":"2026-06-17T07:25:53.840Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-387","url":"https://osv.dev/vulnerability/PYSEC-2026-387","licence":"CC-BY-4.0","modified":"2026-07-01T20:22:56.238Z"}],"updatedAt":"2026-11-25T22:58:39.059Z","epss":{"score":0.01256,"percentile":0.70412,"date":"2026-12-02T12:00:21.000Z"}}