Skip to main content

llama.cpp EUVDEUVD-2026-110569

| CVE-2026-116816 HIGH
Improper Validation of Array Index (CWE-129)
2026-10-27 VulnCheck GHSA-3r8c-j789-2864
8.5
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Publish crafted GGUF model with <0x-1> token
  2. Delivery
    Victim loads model in llama.cpp
  3. Exploit
    Negative index parsed in plamo2 tokenizer build
  4. Execution
    Out-of-bounds write before bytes_ buffer
  5. Impact
    Heap corruption yielding crash or code execution

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Array index validation
Exploitation Conditions

Exploitation requires the victim to load a crafted GGUF model whose PLaMo2 tokenizer (llm_tokenizer_plamo2::build path) includes a BYTE-typed token with an out-of-range value such as <0x-1>; the negative parsed value is used as an index into the bytes_ buffer, producing the out-of-bounds write during model loading. Limiting factors: the attack is local and model-load-driven (AV:L, UI:P) - the attacker must get the victim to load an untrusted/attacker-controlled model, so it does not apply to deployments that only load trusted, vendor-signed models; it is also specific to the PLaMo2 tokenizer code path and to builds from b5899 up to (not including) b10261.

Impact

Signals point to a real but conditional memory-corruption flaw rather than an urgent mass-exploitation threat. The CVSS 4.0 base score of 8.5 is driven by high confidentiality, integrity and availability impact (VC:H/VI:H/VA:H) reflecting potential code execution from a heap out-of-bounds write, but the same vector constrains real-world risk: AV:L means the attack is local (the malicious GGUF model must be loaded on the target), and UI:P means exploitation depends on the victim actively loading an attacker-supplied model. This is not remote-unauthenticated exploitation. Exploitation probability is low (EPSS 0.14%, 3rd percentile) and the CVE is not listed in CISA KEV, so there is no public evidence of active exploitation - consistent with a flaw that requires social-engineering a user into loading an untrusted model file rather than a wormable remote bug. The vuln.today decision label is 'this_week', aligning with a patch-promptly-but-not-emergency posture. Net: a genuine high-severity memory-safety defect whose practical risk is gated by the untrusted-model-loading precondition; prioritize patching for any workflow that ingests third-party or user-supplied GGUF models, but it is not a drop-everything internet-facing emergency.

Exploit ScenarioDerived

An attacker publishes a malicious GGUF model (e.g., on a model-sharing hub) whose PLaMo2 tokenizer contains a BYTE-typed token such as <0x-1>. When a victim loads that model in a vulnerable llama.cpp build, the negative value parsed from the token is used as an array index, writing token ids before the bytes_ buffer and corrupting heap memory, causing a crash or potentially code execution. No standalone public exploit was identified; the vulnerable code path and root cause are documented in the vendor fix diff.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Oct 28, 2026

Heap out-of-bounds write in llama.cpp builds b5899 through b10260 lets an attacker corrupt heap memory when the victim loads a crafted GGUF model that uses the PLaMo2 tokenizer. A BYTE-typed token whose text parses to a negative value (for example <0x-1>) is used as an index into the tokenizer's bytes_ buffer during model loading, so the write lands before the buffer and can crash the process or potentially enable code execution. The flaw is local in nature (it triggers only when an untrusted model is loaded, per the assessed CVSS:3.1/AV:L/AC:L/PR:N/UI:R vector), a vendor patch is available in build b10261, no public exploit has been identified at time of analysis, and EPSS is low at 0.14% (3rd percentile) with a this_week priority label.

RemediationAI

Vendor-released patch: upgrade to llama.cpp build b10261 or later, which contains the validation added by PR 25969 and PR 26511 (commit cf06ad7dfe79e7bf2934150d4fefe1ce8db05490) and is published at https://github.com/ggml-org/llama.cpp/releases/tag/b10261; builds below b10261 and at or above b5899 remain affected. Because exploitation requires the victim to load a crafted model, a practical compensating control until upgrading is to load only GGUF models from trusted, verified sources and to reject models whose tokenizer vocabulary contains BYTE-typed entries with malformed or out-of-range <0xNN> values, with the trade-off that checking tokenizer metadata is a manual gate that does not protect against a trusted-looking but malicious model. Deployments that only ever load vendor-signed, first-party models are outside the assessed attack path, and per the advisory the code fix is the complete remediation.

Affected VersionsENISA

llama.cpp b5899 <b10261

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

The affected code lives in src/llama-vocab.cpp inside llm_tokenizer_plamo2::build, the vocabulary-construction path used for the PLaMo2 tokenizer. When a GGUF model declares a BYTE-typed token, the tokenizer text is expected to look like <0xNN> and is converted with std::stoi(hex_str, nullptr, 16); that parsed integer then serves directly as an index into the bytes_ lookup table. The root cause is CWE-129 (Improper Validation of Array Index): the parsed value is never range-checked, so <0x-1> yields -1 and bytes_[-1] writes one token id before the buffer, and non-hex input makes std::stoi throw an uncaught std::invalid_argument that aborts the process. Because the index is fully attacker-controlled through the model file's tokenizer metadata, a malicious GGUF can place a token id at a negative offset relative to bytes_, within the surrounding heap allocation's metadata or neighboring objects. The upstream fix (PR 25969, follow-up PR 26511, commit cf06ad7) constrains the parse to exactly two hex digits in [00,FF], rejects out-of-range or non-hex values, and skips the store instead of aborting.

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 (VulnCheck) PRIMARY 8.5 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.8 HIGH

Triggered by loading a malicious model file, so AV:L and UI:R; no privileges needed (PR:N); heap OOB write can yield code execution, so C/I/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:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

llama.cpp b5899 before b10261 contains a heap out-of-bounds write vulnerability in llm_tokenizer_plamo2::build that allows attackers to corrupt heap memory via crafted GGUF models. Attackers can supply BYTE-typed token text like <0x-1> whose negative parsed value writes token ids before the bytes_ buffer during model loading, causing crashes or potential code execution.

Executive ViewAI

Why It Matters

A heap memory corruption vulnerability in llama.cpp, a widely used open-source library for running large language models, affects builds b5899 through b10260. When a user loads a crafted GGUF model file that uses the PLaMo2 tokenizer, an attacker can corrupt heap memory, potentially crashing the process or enabling code execution. Although exploitation requires local interaction (loading an untrusted model), the risk is significant for teams using llama.cpp to process third-party or user-supplied models, as a malicious model could compromise the host.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
High
de facto local LLM inference engine, widely embedded across AI tooling
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

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.1%
Patch available Yes
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· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
Medium

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
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.

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-118375 CRITICAL
9.2 Oct 28

Stack-based out-of-bounds write in llama.cpp's ggml-rpc RDMA receive path (builds b8841 through b11865) lets unauthentic

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