CVE-2024-34359
llama-cpp-python vulnerable to Remote Code Execution by Server-Side Template Injection in Model Metadata
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.
INFO
Published Date :
May 14, 2024, 3:38 p.m.
Last Modified :
June 17, 2026, 7:33 a.m.
Remotely Exploit :
Yes !
Source :
[email protected]
Affected Products
The following products are affected by CVE-2024-34359
vulnerability.
Even if cvefeed.io is aware of the exact versions of the
products
that
are
affected, the information is not represented in the table below.
No affected product recoded yet
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 3.1 | CRITICAL | [email protected] |
Public PoC/Exploit Available at Github
CVE-2024-34359 has a 16 public
PoC/Exploit available at Github.
Go to the Public Exploits tab to see the list.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2024-34359.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2024-34359 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2024-34359
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Intentionally-vulnerable INERT corpus proving Zorro catches the 2026 AI-built-software threat surface (malicious models incl. NullifAI/GGUF-SSTI, MCP poisoning, slopsquat, SCA, SAST, IaC, secrets)
Python Dockerfile HCL JavaScript
Deterministic scanner that detects code-executing chat templates in model files (GGUF / Ollama / Hugging Face) before you load the model.
gguf huggingface jinja2 llm model-security ollama sarif sast security supply-chain
Jinja Python
Static, offline security auditor for GGUF model chat templates. Detects silent behavioral backdoors and SSTI without rendering the template or running the model. Scanned all 185k GGUF models on Hugging Face: 24 real malicious templates, 0 false positives.
ai-security backdoor-detection chat-template gguf huggingface jinja2 llm-security prompt-injection security-scanner ssti
Python Jinja
None
Dockerfile Python Shell PowerShell
A curated list of real-world attacks, vulnerabilities, and techniques targeting AI coding agents (Claude Code, Cursor, OpenClaw, Windsurf, Codex)
Squash community VEX feed — OpenVEX 0.2.0 exploitability statements for ML models distributed through squish
Proof of Concept exploitation of CVE-2026-5760 - RCE in SGLang 0.5.9 via malicious GGUF
cve sglang cve-2026-5760
Python
None
Python
This is an AI Security Posture Management (AI-SPM) tool built on Python
Python TypeScript HCL
A repository full of malicious ML model file generators for security scanner testing and red-team exercises.
Python
None
Python
Static security analyzer for ML model files. Finds vulnerabilities in pickle, Keras, GGUF, TensorFlow, and other model formats before they reach production.
Python
None
Python HTML CSS JavaScript
CISO Forum 2025: The AI Governance Blind Spot - Why Your Data Protection Strategy Isn't Ready for Machine Learning
HTML CSS
None
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2024-34359 vulnerability anywhere in the article.
-
Trend Micro
The Road to Agentic AI: Exposed Foundations
Report highlights: Retrieval augmented generation (RAG) enables enterprises to build customized, efficient, and cost-effective applications based on private data. However, research reveals significant ... Read more
The following table lists the changes that have been made to the
CVE-2024-34359 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by [email protected]
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'vendor': 'abetlen', 'product': 'llama-cpp-python', 'versions': [{'status': 'affected', 'version': '>= 0.2.30, <= 0.2.71'}]}] -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'cpes': ['cpe:2.3:a:abetlen:llama-cpp-python:*:*:*:*:*:*:*:*'], 'vendor': 'abetlen', 'product': 'llama-cpp-python', 'versions': [{'status': 'affected', 'version': '0.2.30', 'versionType': 'custom', 'lessThanOrEqual': '0.2.71'}], 'defaultStatus': 'unknown'}] Added SSVC {'id': 'CVE-2024-34359', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'poc'}, {'automatable': 'no'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2024-05-15T19:35:24.408358Z'} -
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://github.com/abetlen/llama-cpp-python/commit/b454f40a9a1787b2b5659cd2cb00819d983185df Added Reference https://github.com/abetlen/llama-cpp-python/security/advisories/GHSA-56xg-wfcc-g829 -
CVE Received by [email protected]
May. 14, 2024
Action Type Old Value New Value Added 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. Added Reference GitHub, Inc. https://github.com/abetlen/llama-cpp-python/security/advisories/GHSA-56xg-wfcc-g829 [No types assigned] Added Reference GitHub, Inc. https://github.com/abetlen/llama-cpp-python/commit/b454f40a9a1787b2b5659cd2cb00819d983185df [No types assigned] Added CWE GitHub, Inc. CWE-76 Added CVSS V3.1 GitHub, Inc. AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H