CriticalVulnerabilityLLM-specific
CVE-2024-34359: llama-cpp-python remote code execution via chat template in GGUF metadata
- Source
- NVD(opens in a new tab)
- Identifier
- CVE-2024-34359
- Published
- Record updated
- Affected
- llama-cpp-python >= 0.2.30, <= 0.2.71
- Fixed in
- 0.2.72
- released May 10, 2024, 4 days before disclosure
- Known exploitation
- Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
- EPSS
- 26.0%
Summary
llama-cpp-python, the Python bindings for llama.cpp, is affected by CVE-2024-34359. The Llama constructor in llama.py loads the chat template from a .gguf model's metadata and passes it to Jinja2ChatFormatter, which parses it with a non-sandboxed jinja2.Environment and renders it in __call__. A carefully constructed template payload therefore enables server-side template injection and remote code execution.
Mitigation
The source does not state a fix yet. Check the original advisory for updates.
Affected packages in the Exposure Registry
Matched by package name and ecosystem. Each entry shows whether the package delegates to a language model and how many tracked packages depend on it.
- llama-cpp-pythonPyPILLM dependency since 2023-03-23 · 8 tracked dependents
Topics
Related items
- MediumCVE-2026-121936: easyVoice server-side request forgery through openaiBaseUrl in /api/v1/ttsSimilar attack · NVD/CVE Database
- MediumCVE-2026-118628: MLflow get-artifacts server-side request forgery information disclosureSimilar attack · NVD/CVE Database
- HighCVE-2026-118625: MLflow Tracking Server privilege escalation via get_endpointsSimilar attack · NVD/CVE Database
- InfoWhen trust becomes the payload: Inside the threats, etc quarterly reportSimilar attack · Elastic Security Labs
- MediumCritical Langflow flaws enable authentication bypass and RCESimilar attack · CSO Online