llama-cpp-python vulnerable to Remote Code Execution by Server-Side Template Injection in Model Metadata
Affects llama-cpp-pythonSource GCVE Database
Not known to be exploited · CVSS 9.6 Critical : upgrade to 0.2.72 as a priority.
Data as of 16 Nov 2026, 17:33 UTC
- Patch
- Available – fixed in 0.2.72
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 13 May 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 15 Nov 2026.
What to do
Upgrade llama-cpp-python to 0.2.72.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIllama-cpp-python | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Users should upgrade to version 0.2.72 or later where this vulnerability is fixed. No other mitigations are indicated by the vendor advisory. Applying the official patch fully addresses the issue.
Description
A critical remote code execution (RCE) vulnerability exists in llama-cpp-python versions 0.2.30 up to but not including 0.2.72. The vulnerability arises from unsafe parsing of a chat template stored in model metadata using Jinja2 without sandboxing, allowing server-side template injection. This flaw enables an attacker to execute arbitrary code on the host running the vulnerable software.
References
- github.com/abetlen/llama-cpp-python/security/advisories/GHSA-56xg-wfcc-g829 (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2024-34359 (opens in a new tab)
- github.com/abetlen/llama-cpp-python/commit/b454f40a9a1787b2b5659cd2cb00819d983185df (opens in a new tab)
- github.com/abetlen/llama-cpp-python (opens in a new tab)
- github.com/pypa/advisory-database/tree/main/vulns/llama-cpp-python/PYSEC-2026-392.yaml (opens in a new tab)
- pypi.org/project/llama-cpp-python (opens in a new tab)