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

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

Other CWE-76 vulnerabilities

Browse all CWE-76 vulnerabilities →