CVE-2024-34359
CVE-2024-34359 is a critical-severity vulnerability with a CVSS 3.x base score of 9.6. Its EPSS exploit-prediction score of 28% places it in the 98th percentile, indicating an elevated likelihood of exploitation. The underlying weakness is classified as CWE-76.
Key facts
- Severity: Critical (CVSS 3.x base score 9.6)
- EPSS exploit prediction: 28% (98th percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2024-1433
- Weakness: CWE-76
- Published:
- Last modified:
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.
Frequently asked questions
- What is CVE-2024-34359?
- 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.
- How severe is CVE-2024-34359?
- CVE-2024-34359 has a CVSS 3.x base score of 9.6, rated critical severity. It is exploitable over network with low attack complexity, requires no privileges and user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2024-34359 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 28% (98th percentile), an estimate of the probability of exploitation in the next 30 days.
- How do I fix CVE-2024-34359?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its critical severity, prioritise patching exposed systems.
- Does CVE-2024-34359 have an EU (EUVD) identifier?
- Yes. CVE-2024-34359 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2024-1433.
- When was CVE-2024-34359 published?
- CVE-2024-34359 was published on 2024-05-14 and last updated on 2026-06-17.
References
- https://github.com/abetlen/llama-cpp-python/commit/b454f40a9a1787b2b5659cd2cb00819d983185df
- https://github.com/abetlen/llama-cpp-python/security/advisories/GHSA-56xg-wfcc-g829
Other CWE-76 vulnerabilities
- CVE-2024-2952 — Critical (CVSS 9.8): BerriAI/litellm is vulnerable to Server-Side Template Injection (SSTI) via the `/completions` endpoint. The…
- CVE-2024-4897 — High (CVSS 8.4): parisneo/lollms-webui, in its latest version, is vulnerable to remote code execution due to an insecure dependency on…
- CVE-2024-1882 — High (CVSS 7.2): This vulnerability allows an already authenticated admin user to create a malicious payload that could be leveraged for…
- CVE-2024-21600 — Medium (CVSS 6.5): An Improper Neutralization of Equivalent Special Elements vulnerability in the Packet Forwarding Engine (PFE) of…
- CVE-2023-1149 — Medium (CVSS 5.4): Improper Neutralization of Equivalent Special Elements in GitHub repository btcpayserver/btcpayserver prior to 1.8.0.
- CVE-2024-1221 — Low (CVSS 3.1): This vulnerability potentially allows files on a PaperCut NG/MF server to be exposed using a specifically formed…