CVE-2024-2952

Server-Side Template Injection in BerriAI/litellm

State
Published
Severity
9.8 Critical
Published
Apr 10, 2024
Updated
Aug 1, 2024
Reserved
Mar 26, 2024

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.09.8 CriticalCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H@huntr_ai

Weaknesses

  • CWE-76 Improper Neutralization of Equivalent Special Elements

Affected Products

ProductVersions
berriai/litellmberriai
  • before 1.34.42Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.