CVE-2026-70638
Received Received - Intake

Integer Overflow in LLaMA-Android JNI Wrapper

Vulnerability report for CVE-2026-70638, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-06

Last updated on: 2026-08-06

Assigner: VulnCheck

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-06
Last Modified
2026-08-06
Generated
2026-08-07
AI Q&A
2026-08-07
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
llama llama_cpp From b1886 (inc) to b7445 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-190 The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
CWE-122 A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is an integer overflow in the LLaMA-Android JNI wrapper of llama.cpp versions b1886 through b7445. The new_1batch() function multiplies sizeof(llama_seq_id) by an attacker-controlled n_seq_max parameter without checking for overflow. This causes incorrect heap buffer allocation, leading to heap corruption. Attackers can exploit this via malicious model files or JNI calls to cause denial of service or arbitrary code execution on Android apps using the LLaMA-Android binding.

Impact Analysis

If you use an Android application that relies on the LLaMA-Android binding from llama.cpp versions b1886 to b7445, an attacker could exploit this flaw to crash the app or execute arbitrary code on your device. This could lead to data theft, unauthorized access, or complete system compromise depending on the app's permissions.

Mitigation Strategies

Update llama.cpp to a version beyond b7445 where the integer overflow issue in new_1batch() is fixed. Avoid using untrusted model files or JNI calls with attacker-controlled n_seq_max values.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-70638. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart