Skip to main content

llama.cpp EUVDEUVD-2026-128232

| CVE-2026-126975 HIGH
Heap-based Buffer Overflow (CWE-122)
2026-11-17 zdi GHSA-6q2w-jx57-7qrg
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
    Deliver via download or malicious page
  3. Exploit
    Victim loads file in llama.cpp
  4. Execution
    Unvalidated layer index overflows heap buffer
  5. Impact
    Execute 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.

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

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

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

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

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

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.

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.3%
Top 79% exploitable
Prevalence
High
extremely popular open-source LLM inference engine, embedded in many downstream apps
Data Quality
6 sources
Confidence: High
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

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.

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