p PatchFirst

CVE-2024-34359

CVE-2024-34359 · llama-cpp-python vulnerable to Remote Code Execution by Server-Side Template Injection in Model Metadata

Diese Seite enthält Fakten aus öffentlichen Sicherheitsquellen. Lesen Sie vor dem Aktualisieren die Originalmeldung.

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.

CVSS 9.7 · Kritisch · EPSS 26,0% · Korrektur verfügbar

Veröffentlicht
Aktualisiert

Technologie-Stack: python

Betroffene Produkte und Versionen

  • llama-cpp-python

    Softwareversionen
    • >= 0.2.30, <= 0.2.71: Betroffen

    Keine Korrektur veröffentlicht

  • llama-cpp-python PyPI

    Softwareversionen
    • 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
    Betroffene Versionsbereiche
    • ECOSYSTEM: ≥ 0.2.30, < 0.2.72

    Auf 0.2.72 aktualisieren

Originalquellen

Prüfen Sie Ihren Server →