CVE-2024-34359
published critical CVSS 3.1 · 9.7llama-cpp-python vulnerable to Remote Code Execution by Server-Side Template Injection in Model Metadata
Package status and fixes
Description
llama-cpp-python is the Python bindings for llama.cpp. `llama-cpp-python` depends on class `Llama` in `llama.py` to load `.gguf` llama.cpp or Latency Machine Learning Models. The `__init__` constructor built in the `Llama` takes several parameters to configure the loading and running of the model. Other than `NUMA, LoRa settings`, `loading tokenizers,` and `hardware settings`, `__init__` also loads the `chat template` from targeted `.gguf` 's Metadata and furtherly parses it to `llama_chat_format.Jinja2ChatFormatter.to_chat_handler()` to construct the `self.chat_handler` for this model. Nevertheless, `Jinja2ChatFormatter` parse the `chat template` within the Metadate with sandbox-less `jinja2.Environment`, which is furthermore rendered in `__call__` to construct the `prompt` of interaction. This allows `jinja2` Server Side Template Injection which leads to remote code execution by a carefully constructed payload.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 9.7 / 10
- Severity
- critical
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| abetlen | llama-cpp-python | >= 0.2.30, <= 0.2.71 (affected) | GitHub_M · cna |
| abetlen | llama-cpp-python | 0.2.30 through 0.2.71 (affected · custom)Default: unknown | CISA-ADP · adp |
Weaknesses
1- CWE-76 CWE-76: Improper Neutralization of Equivalent Special Elements
References
2Provider assertions
3GitHub_M · cna
llama-cpp-python vulnerable to Remote Code Execution by Server-Side Template Injection in Model Metadata
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- e4217e0a94bf31b6f2a82c88cb8b9bac893577dcb37aeb2a6b2f76b4e5b48668
- Ingested
- 23 Sep 2026, 08:23:23 UTC
- Source record
- Official CVE record