Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious GGUF control-vector file
-
DeliveryVictim loads file into llama.cpp
-
ExploitInteger overflow in n_embd × layer_idx (int32)
-
ExecutionUndersized buffer and out-of-bounds heap write
-
ImpactExecute arbitrary code in process context
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
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 load an attacker-supplied malicious GGUF file into llama.cpp, specifically through the control-vector load path (per the fix in common_control_vector_load_one), where an attacker-controlled layer index and embedding count drive an int32 multiplication (result.n_embd * layer_idx) that overflows before the buffer resize/write. Limiting factors: it is a local vector (AV:L), not network-reachable by default, and requires user interaction (UI:R) - the target must open or load the crafted file; no authentication or elevated privileges are needed (PR:N). There are no special non-default configuration prerequisites noted beyond invoking functionality that loads the malicious control-vector/model file. |
| Impact | The CVSS 3.0 base score of 7.8 (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) describes a local, low-complexity, unauthenticated flaw that requires user interaction and yields full confidentiality, integrity and availability impact within the process - a classic 'open a malicious file' memory-corruption pattern, not a remotely reachable network service. Note a terminology mismatch worth flagging to consumers: the title/description call this 'Remote Code Execution' and reference 'remote attackers,' but the CVSS vector is AV:L with UI:R, meaning the realistic delivery is a victim loading an attacker-supplied file, not unauthenticated network exploitation. No EPSS score and no KEV status were provided in the input, and there is no confirmed working exploit; the vuln.today Decision label is 'this_week' (elevated but below act_now/emergency). The patch (PR #31336) narrows the actual defect to control-vector GGUF loading (common_control_vector_load_one), where int32 result.n_embd * layer_idx can overflow before a resize/write - slightly narrower than the generic 'GGUF file parsing' framing. Overall this is a credible, ZDI-validated code-execution bug in a very widely used component, but exploitation depends on convincing a user to load a malicious file, so it is a priority-to-patch rather than a drop-everything emergency on current signals. |
| Exploit ScenarioDerived | An attacker publishes a malicious GGUF control-vector (or model) file on a model-sharing hub or links it from a web page; a user downloads and loads it into llama.cpp. During control-vector loading, an attacker-chosen layer index and embedding size cause an int32 multiplication overflow that produces an undersized allocation and an out-of-bounds heap write, leading to arbitrary code execution in the context of the current process. Exploitation requires user interaction (UI:R) and local file loading (AV:L); no confirmed public exploit is available, though the ZDI advisory and the fixing patch are public. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 18, 2026
Integer overflow during GGUF control-vector parsing in llama.cpp allows an attacker-supplied model file to corrupt heap memory and execute code in the context of the running process. Exploitation is local rather than network-reachable: the victim must open or load a crafted GGUF control-vector file, so no authentication or elevated privileges are needed but user interaction is required (CVSS 7.8, AV:L/AC:L/PR:N/UI:R, C:H/I:H/A:H). The flaw was reported through ZDI (ZDI-26-975 / ZDI-CAN-34553) and an upstream fix is present as pull request 31336 in the ggml-org/llama.cpp repository; no public exploit code or active exploitation was identified at time of analysis.
RemediationAI
Apply the upstream fix from pull request 31336 (https://github.com/ggml-org/llama.cpp/pull/31336), which passes llama_model_n_layer into common_control_vector_load, rejects direction tensors whose layer index exceeds the model's layer count, and widens the n_embd * layer_idx arithmetic to size_t before resize and write; because the fix landed as a PR/commit rather than a confirmed tagged release, an exact patched version number could not be independently confirmed and consumers should pin to a build at or after that merge. Until that build is deployed, the exposed path is the control-vector loader, so the effective mitigation is to avoid loading GGUF control-vector files from untrusted or downloaded sources and to restrict automated pipelines that feed externally supplied models into llama.cpp - the trade-off is loss of control-vector steering and of any workflow that depends on third-party model bundles. Running the loading process under a low-privilege account or sandbox limits post-exploitation impact but does not prevent the overflow itself and can break workloads that need device or file access. Reference advisories: ZDI-26-975 (https://www.zerodayinitiative.com/advisories/ZDI-26-975/) and the upstream pull request above.
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
llama.cpp loads optional control vectors alongside a model, and each direction tensor inside a GGUF file carries a layer index plus an embedding dimension (n_embd) taken directly from file metadata. Per the upstream fix in common_control_vector_load_one, the code computed a buffer offset as an int32 product result.n_embd * layer_idx and only afterwards widened the result to size_t for the resize and the float* destination write. Since both operands are attacker-controlled and unbounded, the multiplication can wrap, producing a far too small allocation relative to the layer index actually used and letting the subsequent write run past the end of the vector - the CWE-190 integer-overflow-before-write pattern noted in the advisory. The patch threads the model's true layer count (llama_model_n_layer) into the loader, rejects any direction tensor whose layer_idx exceeds n_layer, and performs the size computation in size_t so the multiplication cannot wrap. The same pull request also reworks position-embedding index generation in tools/mtmd/clip.cpp so patch/merge loops compute y and x from tile indices rather than accumulating raw patch coordinates. Notably, the vendor description frames the issue as remotely exploitable, but the assessed vector is local (AV:L) with user interaction (UI:R): the practical attack surface is a user or application loading an untrusted GGUF/control-vector file into the process.
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
Attacker supplies a malicious local file with no privileges (PR:N) but the user must open/load it (AV:L, UI:R); reliable int32 overflow gives AC:L and in-process code execution gives C:H/I:H/A:H.
Primary rating from Vendor (zdi).
CVSS VectorVendor: zdi
DescriptionCVE.org
llama.cpp GGUF File Parsing Integer 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 user-supplied data, which can result in an integer overflow before writing to memory. An attacker can leverage this vulnerability to execute arbitrary code in the context of the current process. Was ZDI-CAN-34553.
Executive ViewAI
A high-severity integer overflow vulnerability in llama.cpp, a widely used open-source library for running large language models, allows a malicious model file to corrupt memory and execute code on the local system. This flaw impacts any developer or system that loads untrusted GGUF model files, potentially enabling unauthorized access or compromise of the host environment. Leadership should prioritize mitigation because it poses a direct risk to development and research workstations, and though exploitation requires user interaction, the growing use of AI tools increases exposure.
No vendor-released patch identified at time of analysis. Interim mitigations include: only loading GGUF files from trusted, verified sources; disabling control-vector parsing if not required; running llama.cpp in a sandboxed environment with least privilege; and monitoring for anomalous process behavior.
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
Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.
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-128231
GHSA-935v-h6wh-q726
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB