Skip to main content

llama.cpp Android CVE-2026-70638

| EUVDEUVD-2026-54276 HIGH
Heap-based Buffer Overflow (CWE-122)
2026-08-06 disclosure@vulncheck.com GHSA-p56f-gv6x-v6mg
8.5
CVSS 4.0 · Vendor: vulncheck
View

Attack ChainAIDerived

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

  1. Access
    Distribute crafted GGUF model via third-party repository
  2. Delivery
    User downloads and loads model into vulnerable Android app
  3. Exploit
    Malicious n_seq_max triggers integer overflow in new_1batch()
  4. Execution
    Heap underallocation computed
  5. Persist
    Out-of-bounds write corrupts heap
  6. Impact
    Denial of service or arbitrary code execution within app process

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 a user to load a malicious GGUF model file - or receive a crafted JNI call - targeting an Android application compiled against llama.cpp builds b1886 through b7445 with the LLaMA-Android JNI wrapper. The CVSS 4.0 vector specifies AV:L (local attack surface - the malicious file must be on-device and accessible to the application), PR:N (no special privilege level on the Android side is required for exploitation), and UI:P (passive user interaction is required - the user must open or use the app with the malicious model loaded). Exploitation is limited to the Android platform and specifically to applications that have integrated the examples/llama.android binding; the core llama.cpp library on Linux, macOS, or Windows is not confirmed affected by this specific code path. The key limiting factor is the model file delivery: an attacker must convince the user to load a crafted GGUF file, which is plausible in ecosystems where models are routinely downloaded from community repositories but is not a zero-click or network-adjacent attack.

Impact

The CVSS 4.0 score of 8.5 with vector AV:L/AC:L/AT:N/PR:N/UI:P reflects a local attack requiring passive user interaction - the user must open or process a malicious GGUF model file - which is a realistic and common action for Android LLM applications where users routinely source models from third parties. The high CIA impact metrics (VC:H/VI:H/VA:H) reflect worst-case RCE within the app process, while SC:N/SI:N/SA:N confirms the scope is contained to the vulnerable application. No EPSS data was provided in the input, so exploitation probability from threat intelligence signals cannot be quantified. The CVE is not listed in CISA KEV, and no POC was referenced, so this should not be treated as actively exploited at time of analysis. Real-world risk is moderate-to-high specifically for Android applications that allow users to load arbitrary GGUF files from untrusted sources; for deployments restricted to vetted, vendor-supplied models, exploitability is substantially reduced. The tags include both DoS and RCE, and reliability of code execution versus crash depends on heap layout - attackers may need additional primitives for reliable RCE beyond the overflow itself.

Exploit ScenarioDerived

An attacker crafts a malicious GGUF model file with a deliberately oversized n_seq_max metadata field and distributes it through a third-party model repository, a phishing link, or a compromised model hub. When a user downloads and loads this file into an Android application built on llama.cpp builds b1886-b7445, the new_1batch() function multiplies the oversized n_seq_max by sizeof(llama_seq_id), overflows the integer, and allocates a heap buffer far smaller than required. Subsequent writes into this buffer corrupt adjacent heap metadata, leading to a crash (DoS) or, under controlled heap layout conditions, arbitrary code execution within the app's process - enabling data exfiltration or malware installation on the device.

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

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

Alert me

AnalysisAIv1 – Aug 06, 2026

Integer overflow in the llama.cpp LLaMA-Android JNI wrapper (builds b1886 through b7445) allows heap corruption through a crafted n_seq_max parameter, enabling denial of service or arbitrary code execution within Android applications that load untrusted GGUF model files. The flaw exists in the new_1batch() function, which multiplies sizeof(llama_seq_id) by an attacker-controlled value without bounds checking, causing heap allocation to wrap and undersize the buffer. No public exploit has been identified at time of analysis and this CVE is not in CISA KEV; a patched release (b7446) is confirmed available from the upstream ggml-org repository.

RemediationAI

Upgrade to llama.cpp build b7446 or later, which is confirmed available at https://github.com/ggml-org/llama.cpp/releases/tag/b7446 and addresses the integer overflow via the upstream commit https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388. As a compensating control prior to patching, restrict Android applications from loading GGUF model files sourced from user-controlled or untrusted locations - this eliminates the primary delivery vector at the cost of reduced user flexibility. Additionally, input validation of the n_seq_max parameter at the JNI boundary before it reaches new_1batch() can prevent the overflow; however, this is a code-level mitigation requiring a custom build. Applications that exclusively load cryptographically signed or vendor-pinned model files from controlled repositories are not practically exploitable via the documented attack path.

Affected VersionsENISA

llama.cpp 0.9.0 ≤0.17.1
llama.cpp b1886 ≤b7445

Affected Packages

euvd llama_cpp no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

CWE-122 (Heap-based Buffer Overflow) describes this class of flaw: the allocation size is computed as sizeof(llama_seq_id) multiplied by the attacker-controlled n_seq_max integer parameter inside new_1batch(), a function in the LLaMA-Android JNI wrapper (examples/llama.android). When n_seq_max is crafted to be sufficiently large, the multiplication overflows the integer type before being passed to the allocator, yielding a heap allocation smaller than the volume of data subsequently written. The result is a classic heap underallocation leading to out-of-bounds writes. The Android JNI layer bridges Java/Kotlin application code to the native llama.cpp C++ library, and this vulnerability exists specifically in that boundary layer. No CPE string was provided; affected artifacts are the llama.cpp project (ggml-org/llama.cpp) builds b1886 through b7445, Android binding component only. The fix commit is at https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388 and was released as build b7446.

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

Local attack vector via malicious model file loaded by the user (UI:R); no privileges required on the Android side; full CIA impact within the app process if heap corruption leads to RCE.

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

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 builds b1886 through b7445 contain an integer overflow vulnerability in the LLaMA-Android JNI wrapper where the new_1batch() function multiplies sizeof(llama_seq_id) by an attacker-controlled n_seq_max parameter without overflow validation, causing heap buffer allocation to wrap and allocate insufficient memory. Attackers can exploit this by providing a crafted n_seq_max value through a malicious model file or JNI call to trigger heap corruption and achieve denial of service or arbitrary code execution on Android applications using the LLaMA-Android binding.

Executive ViewAI

Why It Matters

An integer overflow vulnerability in llama.cpp's LLaMA-Android JNI wrapper (builds b1886-b7445) enables arbitrary code execution or denial of service when Android applications load untrusted GGUF model files, directly exposing user devices to compromise. Organizations deploying applications built with vulnerable llama.cpp versions face immediate risk of application crashes or remote code execution on end-user devices.

Business Impact: High
Compensating Controls

Vendor-released patch: b7446 available from upstream ggml-org repository. Until patching is complete, restrict GGUF model file loading to trusted sources only and consider disabling features that load external models.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
Medium
popular open-source LLM runtime, Android binding is a niche subset
Social Media
1
Sightings
Data Quality
9 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL 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.1%
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
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

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.

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.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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

Vendor StatusVendor

SUSE

Severity: Important

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