CVE-2024-2952

CRITICAL
Published Apr 10, 2024 Modified Jul 15, 2025 CWE-76

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.

CVSS v3.1 Score

9.8
CRITICAL
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Weakness Type (CWE)

CWE-76 CWE-76

Affected Products

Vendor Product
litellm litellm

References

Frequently Asked Questions

What is CVE-2024-2952? +
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. It has a CVSS v3.1 base score of 9.8 (CRITICAL).
How severe is CVE-2024-2952? +
CVE-2024-2952 has a CVSS v3.1 score of 9.8 out of 10, rated CRITICAL. This is a critical vulnerability that should be patched immediately.
What products are affected by CVE-2024-2952? +
CVE-2024-2952 affects products from litellm, specifically: litellm. Check the affected products table above for specific version ranges.
How do I check if I'm vulnerable to CVE-2024-2952? +
You can use Secably's free Website Scanner to check your website for known vulnerabilities. For infrastructure scanning, use the Port Scanner to identify exposed services that may be affected. Check the vendor advisories linked above for specific patch and version information.

Related Vulnerabilities

Don't wait for an exploit

Scan your website for vulnerabilities like CVE-2024-2952 — free, no signup required.

Start Free Scan