Skip to content
Sign in
CVE-2024-343599.7CriticalCWE-76

CVE-2024-34359: llama-cpp-python vulnerable to Remote Code Execution by Server-Side Template Injection in Model Metadata

abetlen · llama-cpp-python

Affected: abetlen llama-cpp-python · Exploitation: likely to be exploited (10% or more)

Not in CyberSIXT coverage yet: no article names this CVE. This page shows the public record.

26.0%probability of exploitation in the next 30 days
98th percentile
050100

Higher than 98% of scored CVEs

9.7CriticalCVSS 3.1
LowCrit.

DescriptionCVE.org

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.

Affected products1

From the CVE record. A product or version that is not listed is unknown, not unaffected.

  • abetlen · llama-cpp-python>= 0.2.30, <= 0.2.71

On the Atlas

Every published CVE is on the CyberSIXT Atlas, grouped by weakness, vendor and month.

Open the Atlas
Exploitation
Likely to be exploited (10% or more). EPSS gives it a 10% or higher chance of exploitation in the next 30 days.
CISA KEV
Not listed
Public check
No public nuclei template
Published
May 2024

CoverageNo articles yet

No CyberSIXT article names CVE-2024-34359 yet, so there is no coverage timeline, action brief or change log for it. Everything on this page comes from the public CVE record, CISA KEV, EPSS and the nuclei template index. Search the archive or see the CVEs in the news.

References

Updated AboutDevelopersSign in