abetlen llama-cpp-python bis 0.2.71 llama.py to_chat_handler Remote Code Execution

CVSS Meta Temp ScoreAktueller Exploitpreis (≈)CTI Interest Score
7.9$0-$5k0.00

Zusammenfassunginfo

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.

Detailsinfo

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.

Produktinfo

Typ

Hersteller

Name

Version

Webseite

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Zuverlässigkeit: 🔍

CVSSv3info

VulDB Meta Base Score: 7.9
VulDB 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: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VektorKomplexitätAuthentisierungVertraulichkeitIntegritätVerfügbarkeit
freischaltenfreischaltenfreischaltenfreischaltenfreischaltenfreischalten
freischaltenfreischaltenfreischaltenfreischaltenfreischaltenfreischalten
freischaltenfreischaltenfreischaltenfreischaltenfreischaltenfreischalten

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Zuverlässigkeit: 🔍

Exploitinginfo

Klasse: Remote Code Execution
CWE: 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-Dayfreischaltenfreischaltenfreischaltenfreischalten
Heutefreischaltenfreischaltenfreischaltenfreischalten

Threat Intelligenceinfo

Interesse: 🔍
Aktive Akteure: 🔍
Aktive APT Gruppen: 🔍

Gegenmassnahmeninfo

Empfehlung: keine Massnahme bekannt
Status: 🔍

0-Day Time: 🔍

Timelineinfo

02.05.2024 🔍
10.05.2024 +8 Tage 🔍
10.05.2024 +0 Tage 🔍
30.03.2025 +324 Tage 🔍

Quelleninfo

Produkt: github.com

Advisory: github.com
Status: Bestätigt

CVE: CVE-2024-34359 (🔍)
GCVE (CVE): GCVE-0-2024-34359
GCVE (VulDB): GCVE-100-263867

Eintraginfo

Erstellt: 10.05.2024 20:42
Aktualisierung: 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.

Diskussion

 Anonymous User
(+0)
vor 2 Jahren
Good morning.
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
At the moment it is unclear what kind of dependencies are given. We have to remain to assign the core product only for now. Thank you for your understanding.

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!