Skip to main content
Public proof of conceptFix available

CVE-2024-34359

A public proof of concept exists; no exploitation attested.

  • Published2024-05-14
  • Fixed in0.2.72
  • WeaknessCWE-76

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2024-05-1415:38CVE publishedNVD

Versions per branch

OSV · CISA-ADP
llama-cpp-python
BranchAffectedFixed in
0.2≥ 0.2.30, < 0.2.720.2.72
Abetlen llama-cpp-python
BranchAffectedFixed in
0.2≥ 0.2.30, ≤ 0.2.71no fix published

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As GitHub_M, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • abetlen llama-cpp-python
    Affected
    • = >= 0.2.30, <= 0.2.71no fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2024-05-10

Fix

  1. Update llama-cpp-python to 0.2.72

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

  • NVDCVE recordread 2026-10-23
  • CISA-ADPSSVC decisionpoc2024-05-15
  • CNACVSS 3.19.6known since 2026-10-23
  • CNAweakness (CWE)CWE-76known since 2026-10-23
  • FIRST EPSSEPSS score26.0 %read 2026-11-09
  • OSVaffected packages—
  • GitHub AdvisoriesadvisoryCRITICAL2024-05-13

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Published
2024-05-14
Last Modified
2026-06-17
NVD status
Deferred
GitHub Advisory
GHSA-56xg-wfcc-g829

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.

Is CVE-2024-34359 actively exploited?

A proof-of-concept exploit exists for CVE-2024-34359, but active exploitation has not been confirmed at this time.

What is the CVSS score for CVE-2024-34359?

CVE-2024-34359 has a CVSS v3 base score of 9.6 (CRITICAL severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.

Running llama-cpp-python? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record