Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2024-34359
May 10, 2024
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 Packages
llama-cpp-python (PYTHON):
Affected version(s) >=0.2.30 <0.2.72
Fix Suggestion:
Update to version 0.2.72
Do you need more information?
Contact Us
CVSS v4
Base Score:
9.4
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
PASSIVE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
HIGH
Subsequent System Integrity
HIGH
Subsequent System Availability
HIGH
CVSS v3
Base Score:
9.6
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Weakness Type (CWE)
Improper Neutralization of Equivalent Special Elements
EPSS
Base Score:
59.17