Skip to main content

llama.cpp CVE-2026-126974

| EUVDEUVD-2026-128231 HIGH
Integer Overflow or Wraparound (CWE-190)
2026-11-17 zdi GHSA-935v-h6wh-q726
7.8
CVSS 3.0 · Vendor: zdi
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious GGUF control-vector file
  2. Delivery
    Victim loads file into llama.cpp
  3. Exploit
    Integer overflow in n_embd × layer_idx (int32)
  4. Execution
    Undersized buffer and out-of-bounds heap write
  5. Impact
    Execute 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

llama.cpp b11160 (70c4e1582)

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

Vendor (zdi) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

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.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (zdi).

CVSS VectorVendor: zdi

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.3%
Top 81% exploitable
Prevalence
High
de facto local LLM inference engine, embedded in many AI applications
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

CVE-2024-42479 CRITICAL POC
10.0 Aug 12

Arbitrary memory write in llama.cpp's RPC server allows remote unauthenticated attackers to corrupt arbitrary memory add

CVE-2024-21802 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) is possible when a user opens a malicious .gguf model file, triggeri

CVE-2026-21869 HIGH POC
8.8 Jan 08

Llama.cpp server endpoints fail to validate the n_discard parameter from JSON input, allowing negative values that trigg

CVE-2024-21825 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) is possible when a victim loads a malicious .gguf model file, trigge

CVE-2024-23605 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (GGUF library) allows attackers to achieve arbitrary code execution by tricking a use

CVE-2024-23496 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) occurs when the GGUF library's gguf_fread_str function parses a mali

CVE-2024-21836 HIGH POC
8.8 Feb 26

Heap-based buffer overflow in llama.cpp's GGUF library header parser (commit 18c2e17) enables code execution when a vict

CVE-2025-52566 HIGH POC
8.6 Jun 24

CVE-2025-52566 is a signed vs. unsigned integer overflow vulnerability in llama.cpp's tokenizer (llama_vocab::tokenize f

CVE-2026-34159 CRITICAL
9.8 Apr 01

Remote code execution in llama.cpp RPC backend allows unauthenticated attackers with TCP access to achieve arbitrary mem

CVE-2024-42478 MEDIUM POC
5.3 Aug 12

llama.cpp provides LLM inference in C/C++. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable,

CVE-2026-43629 CRITICAL
9.2 Aug 06

Heap buffer overflow in llama.cpp's server KV cache state-restore path (builds b4882 through b9058) lets an attacker who

CVE-2026-137567 CRITICAL
9.3 Nov 26

Unauthenticated remote attackers who can reach the ggml RPC server in llama.cpp b11450 before b12658 can exploit an out-

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy