CVE-2024-2952:
LiteLLM has Server-Side Template Injection vulnerability in /completions endpoint
9.8
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.76775%
CWE
Published
4/10/2024
Updated
4/11/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
litellm | pip | < 1.34.42 | 1.34.42 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the hf_chat_template function using Jinja's default Environment() to render user-controlled templates. The commit diff shows the fix replaced Environment() with ImmutableSandboxedEnvironment, which confirms the original implementation lacked proper sandboxing. This allowed attackers to inject template code that executes arbitrary Python commands through specially crafted tokenizer_config.json files. The function's direct handling of external template input without safe rendering mechanisms makes it clearly vulnerable.