cve.bz

CVE-2024-34359 (Llama Drama) abetlen llama-cpp-python

9.6 criticalEPSS 26%Fix available

Known as Llama Drama

Critical (9.6) in abetlen llama-cpp-python. EPSS 26% estimated probability of exploitation activity in the next 30 days. Fixed in llama-cpp-python 0.2.72.

On this page
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.

Severity

CVSS 3.1

9.6 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
EPSS
26% (unchanged from 26% a week ago; 26% 30 days ago) estimated probability of exploitation activity in the next 30 days; 98th percentile. Scored 2026-11-21. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: total, assessed 2024-05-15. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-76 Improper Neutralization of Equivalent Special Elements
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

  • llama-cpp-python (PyPI): fixed in 0.2.72

Ask an AI about this CVE

Show the promptExplain CVE-2024-34359 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-34359?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-34359?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-34359 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
abetlen llama-cpp-python>= 0.2.30, <= 0.2.71

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-56xg-wfcc-g829PyPIllama-cpp-python>=0.2.30 <0.2.720.2.72
PYSEC-2026-392PyPIllama-cpp-python>=0.2.30 <0.2.720.2.72

References

Check your stackJSON