abetlen llama-cpp-python bis 0.2.71 llama.py to_chat_handler Remote Code Execution
| CVSS Meta Temp Score | Aktueller Exploitpreis (≈) | CTI Interest Score |
|---|---|---|
| 7.9 | $0-$5k | 0.00 |
Zusammenfassung
Es wurde eine kritische Schwachstelle in abetlen llama-cpp-python bis 0.2.71 entdeckt. Hiervon betroffen ist die Funktion to_chat_handler der Datei llama.py. Durch Beeinflussen mit unbekannten Daten kann eine Remote Code Execution-Schwachstelle ausgenutzt werden.
Diese Verwundbarkeit ist als CVE-2024-34359 gelistet. Ein Angriff ist aus der Distanz möglich. Es existiert kein Exploit.
Details
Eine kritische Schwachstelle wurde in abetlen llama-cpp-python bis 0.2.71 gefunden. Dies betrifft die Funktion to_chat_handler der Datei llama.py. Durch Beeinflussen mit einer unbekannten Eingabe kann eine Remote Code Execution-Schwachstelle ausgenutzt werden. Klassifiziert wurde die Schwachstelle durch CWE als CWE-76. Die Auswirkungen sind bekannt für Vertraulichkeit, Integrität und Verfügbarkeit. Die Zusammenfassung von CVE lautet:
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.Das Advisory findet sich auf github.com. Die Verwundbarkeit wird seit dem 02.05.2024 mit der eindeutigen Identifikation CVE-2024-34359 gehandelt. Sie ist leicht ausnutzbar. Umgesetzt werden kann der Angriff über das Netzwerk. Das Ausnutzen erfordert keine spezifische Authentisierung. Eine Ausnutzung erfordert, dass das Opfer eine spezifische Handlung durchführt. Zur Schwachstelle sind technische Details bekannt, ein verfügbarer Exploit jedoch nicht.
Es sind keine Informationen bezüglich Gegenmassnahmen bekannt. Der Einsatz eines alternativen Produkts bietet sich im Zweifelsfall an.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Produkt
Typ
Hersteller
Name
Version
- 0.2.0
- 0.2.1
- 0.2.2
- 0.2.3
- 0.2.4
- 0.2.5
- 0.2.6
- 0.2.7
- 0.2.8
- 0.2.9
- 0.2.10
- 0.2.11
- 0.2.12
- 0.2.13
- 0.2.14
- 0.2.15
- 0.2.16
- 0.2.17
- 0.2.18
- 0.2.19
- 0.2.20
- 0.2.21
- 0.2.22
- 0.2.23
- 0.2.24
- 0.2.25
- 0.2.26
- 0.2.27
- 0.2.28
- 0.2.29
- 0.2.30
- 0.2.31
- 0.2.32
- 0.2.33
- 0.2.34
- 0.2.35
- 0.2.36
- 0.2.37
- 0.2.38
- 0.2.39
- 0.2.40
- 0.2.41
- 0.2.42
- 0.2.43
- 0.2.44
- 0.2.45
- 0.2.46
- 0.2.47
- 0.2.48
- 0.2.49
- 0.2.50
- 0.2.51
- 0.2.52
- 0.2.53
- 0.2.54
- 0.2.55
- 0.2.56
- 0.2.57
- 0.2.58
- 0.2.59
- 0.2.60
- 0.2.61
- 0.2.62
- 0.2.63
- 0.2.64
- 0.2.65
- 0.2.66
- 0.2.67
- 0.2.68
- 0.2.69
- 0.2.70
- 0.2.71
Webseite
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔍VulDB Zuverlässigkeit: 🔍
CVSSv3
VulDB Meta Base Score: 7.9VulDB Meta Temp Score: 7.9
VulDB Base Score: 6.3
VulDB Temp Score: 6.3
VulDB Vector: 🔍
VulDB Zuverlässigkeit: 🔍
CNA Base Score: 9.6
CNA Vector: 🔍
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vektor | Komplexität | Authentisierung | Vertraulichkeit | Integrität | Verfügbarkeit |
|---|---|---|---|---|---|
| freischalten | freischalten | freischalten | freischalten | freischalten | freischalten |
| freischalten | freischalten | freischalten | freischalten | freischalten | freischalten |
| freischalten | freischalten | freischalten | freischalten | freischalten | freischalten |
VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Zuverlässigkeit: 🔍
Exploiting
Klasse: Remote Code ExecutionCWE: CWE-76 / CWE-707 / CWE-20
CAPEC: 🔍
ATT&CK: 🔍
Physisch: Nein
Lokal: Nein
Remote: Ja
Verfügbarkeit: 🔍
Status: Nicht definiert
EPSS Score: 🔍
EPSS Percentile: 🔍
Preisentwicklung: 🔍
Aktuelle Preisschätzung: 🔍
| 0-Day | freischalten | freischalten | freischalten | freischalten |
|---|---|---|---|---|
| Heute | freischalten | freischalten | freischalten | freischalten |
Threat Intelligence
Interesse: 🔍Aktive Akteure: 🔍
Aktive APT Gruppen: 🔍
Gegenmassnahmen
Empfehlung: keine Massnahme bekanntStatus: 🔍
0-Day Time: 🔍
Timeline
02.05.2024 🔍10.05.2024 🔍
10.05.2024 🔍
30.03.2025 🔍
Quellen
Produkt: github.comAdvisory: github.com
Status: Bestätigt
CVE: CVE-2024-34359 (🔍)
GCVE (CVE): GCVE-0-2024-34359
GCVE (VulDB): GCVE-100-263867
Eintrag
Erstellt: 10.05.2024 20:42Aktualisierung: 30.03.2025 23:13
Anpassungen: 10.05.2024 20:42 (62), 30.03.2025 23:13 (3)
Komplett: 🔍
Cache ID: 216::103
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
As this vulnerability allows attackers to execute arbitrary code resulting from improper use of the Jinja2 template engine.
Over 6,000 HuggingFace AI models using llama_cpp_python and Jinja2 are vulnerable.
For this reason you could add the following cpe:
jinja2:jinja2
Pocoo:jinja2
We would appreciate it very much.
Best Regards,
TEAM CERT
Are you interested in using VulDB?
Download the whitepaper to learn more about our service!