Advisory

PYSEC-2026-387

Also known as: CVE-2024-2952, GHSA-46cm-pfwv-cgf8

Summary

LiteLLM has Server-Side Template Injection vulnerability in /completions endpoint

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.

Severity

Critical Basis: CVSS v3 score 9.8, vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Dates

Published
2026-06-29 11:50 UTC
Modified
2026-07-01 20:22 UTC

Affected packages and fixes

litellm

PyPI · All systems

Affected

  • introduced 0, fixed 1.34.42 (ecosystem)

Fixed versions

1.34.42

Fix

  • Fixed version 1.34.42
    pip install --upgrade litellm==1.34.42

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences