Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious GGUF control-vector file
-
DeliveryDeliver via download or malicious page
-
ExploitVictim loads file in llama.cpp
-
ExecutionUnvalidated layer index overflows heap buffer
-
ImpactExecute arbitrary code in process context
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the victim to locally load an attacker-supplied file into llama.cpp (AV:L, UI:R) - it is not remote/unauthenticated against a listening service. Based on the patch evidence, the confirmed trigger is a control-vector GGUF whose direction-tensor layer index exceeds the model's layer count (previously unchecked against n_layer in common_control_vector_load_one), causing an out-of-bounds heap write during control_vector load (e.g., via the --control-vector path). Limiting factors: the user must open/load the malicious file, the relevant feature (control-vector loading, or the affected multimodal/clip path) must be exercised, and the vector is local rather than network-reachable. Authentication requirements: PR:N in the CVSS vector indicates no privileges required, but note AV:L means local file access/interaction is the gating condition rather than network reachability. |
| Impact | CVSS 3.0 base score is 7.8 (High), but the vector is CVSS:3.0/AV:L/AC:L/PR:N/UI:R - a LOCAL attack vector requiring user interaction, not a remotely reachable flaw. Note the conflict: the ZDI description uses the boilerplate phrase 'remote attackers' and 'visit a malicious page,' yet the CVSS vector encodes AV:L with UI:R, meaning a victim must open or load an attacker-supplied file locally - treat this as a file-borne, social-engineering-dependent issue rather than a drive-by network exploit, and verify the delivery assumption with the vendor/ZDI. No EPSS score was provided, the CVE is NOT in CISA KEV, and no public exploit code is identified in the inputs (only the ZDI advisory and the patch PR are referenced). The vuln.today decision label is 'this_week,' indicating elevated but non-emergency priority. Net assessment: a genuine high-impact memory-corruption RCE (full C:H/I:H/A:H) worth prompt patching, but real-world risk is moderated by the user-interaction requirement and local vector; the primary exposure is to users and services that load untrusted GGUF model/control-vector files. The wide deployment of llama.cpp raises aggregate exposure even though no mass-exploitation signal (KEV/EPSS) is present. |
| Exploit ScenarioDerived | An attacker crafts a malicious GGUF/control-vector file and lures a victim into loading it in a vulnerable llama.cpp build (e.g., distributed as a downloadable model or control vector). On load, unvalidated user-supplied length/layer-index data is copied past a heap buffer, corrupting memory and enabling arbitrary code execution in the context of the llama.cpp process. Exploitation requires local file handling and user interaction (AV:L/UI:R); no public exploit code is identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 18, 2026
Heap-based buffer overflow in llama.cpp's GGUF parsing path allows code execution in the context of the current process when a user loads a crafted model or control-vector file. The assessed vector is CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (7.8 High) - a local, user-interaction-driven flaw rather than a remotely reachable service bug, since the victim must open the attacker-supplied file. The confirmed trigger, per the upstream fix in PR 31336, is a control-vector direction tensor whose layer index exceeds the model's layer count, producing an out-of-bounds heap write of float data; no public exploit code has been identified at time of analysis and the issue is not in CISA KEV, though the vendor-classified RCE impact and this_week priority warrant prompt upgrading.
RemediationAI
Upstream fix available (PR/commit); released patched version not independently confirmed - apply the changes in https://github.com/ggml-org/llama.cpp/pull/31336 (which adds an n_layer bounds check on control-vector direction-tensor layer indices plus corrected merge_ratio index arithmetic in clip.cpp) or update to a build that contains them, and consult ZDI-26-976 at https://www.zerodayinitiative.com/advisories/ZDI-26-976/ for vendor guidance. Until a patched build is deployed, the actionable compensating control is to avoid loading untrusted GGUF control-vector files and untrusted multimodal/image inputs into llama.cpp, since the overflow is reached only when the control-vector or clip path processes attacker-controlled data; the trade-off is that this removes the ability to share or download third-party control vectors and adapter-style assets. Restricting who can place model and vector files into the directories llama.cpp reads from, and running the process under an unprivileged account or sandbox so a successful heap write cannot escalate beyond the current process context, limits blast radius but does not remove the vulnerability itself.
Affected VersionsENISA
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
GGUF is the binary model container format used by llama.cpp and the wider ggml ecosystem; it stores tensor metadata (name, dimensions, type) alongside raw tensor data, and parsers must validate declared dimensions against the actual buffer sizes before allocating and copying. The flaw is CWE-122 (heap-based buffer overflow): in common_control_vector_load_one(), the layer index read from a control-vector GGUF direction tensor was used to size and offset a std::vector<float> write (result.data.resize(... result.n_embd * layer_idx) followed by dst = result.data.data() + result.n_embd * (layer_idx - 1)) without checking the index against the loaded model's n_layer. The fix threads llama_model_n_layer(model) into common_control_vector_load()/common_control_vector_load_one(), rejects direction tensors whose layer index exceeds n_layer, and casts the size arithmetic to size_t to prevent integer overflow in the offset computation. The same PR also corrects patch/merge_ratio index arithmetic in the multimodal clip.cpp position-embedding loops (tools/mtmd), which is the clip path referenced in the assessment; note the CVSS metrics describe severity only and do not by themselves establish the trigger mechanism.
Know when Llama Cpp gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Local file-load vector (AV:L) with required user interaction (UI:R) and no privileges (PR:N); the heap overflow yields full code execution, so C:H/I:H/A:H with unchanged scope.
Primary rating from Vendor (zdi).
CVSS VectorVendor: zdi
DescriptionCVE.org
llama.cpp GGUF File Parsing Heap-based Buffer Overflow Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of llama.cpp. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.
The specific flaw exists within the parsing of GGUF files. The issue results from the lack of proper validation of the length of user-supplied data prior to copying it to a heap-based buffer. An attacker can leverage this vulnerability to execute arbitrary code in the context of the current process. Was ZDI-CAN-34558.
Executive ViewAI
CVE-2026-126975 is a high-severity heap overflow in llama.cpp's GGUF parsing that allows arbitrary code execution when a user loads a malicious model or control-vector file. Because successful exploitation requires the victim to interact with the crafted file, the practical risk is concentrated among employees who download models from untrusted sources-an increasingly common workflow in AI development. Leadership should care because a single compromised model file can lead to full compromise of the user's workstation and any credentials or data it can reach.
No vendor-released patch identified at time of analysis. Interim mitigations include prohibiting downloads of GGUF and control-vector files from untrusted sources, scanning model files before use, restricting execution of llama.cpp to isolated or low-privilege environments, and monitoring for anomalous process behavior on developer endpoints.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Arbitrary memory write in llama.cpp's RPC server allows remote unauthenticated attackers to corrupt arbitrary memory add
Remote code execution in llama.cpp (commit 18c2e17) is possible when a user opens a malicious .gguf model file, triggeri
Llama.cpp server endpoints fail to validate the n_discard parameter from JSON input, allowing negative values that trigg
Remote code execution in llama.cpp (commit 18c2e17) is possible when a victim loads a malicious .gguf model file, trigge
Remote code execution in llama.cpp (GGUF library) allows attackers to achieve arbitrary code execution by tricking a use
Remote code execution in llama.cpp (commit 18c2e17) occurs when the GGUF library's gguf_fread_str function parses a mali
Heap-based buffer overflow in llama.cpp's GGUF library header parser (commit 18c2e17) enables code execution when a vict
CVE-2025-52566 is a signed vs. unsigned integer overflow vulnerability in llama.cpp's tokenizer (llama_vocab::tokenize f
Remote code execution in llama.cpp RPC backend allows unauthenticated attackers with TCP access to achieve arbitrary mem
llama.cpp provides LLM inference in C/C++. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable,
Heap buffer overflow in llama.cpp's server KV cache state-restore path (builds b4882 through b9058) lets an attacker who
Unauthenticated remote attackers who can reach the ggml RPC server in llama.cpp b11450 before b12658 can exploit an out-
EUVD-2026-128232
GHSA-6q2w-jx57-7qrg
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB