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.
Published: 2026-08-06
Score: 8.5 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is an integer overflow in the LLaMA-Android JNI wrapper’s new_1batch() function, where the size for a heap buffer is computed by multiplying sizeof(llama_seq_id) by an attacker-controlled n_seq_max parameter without validation. This overflow allows the allocation to wrap and allocate less memory than required, leading to heap corruption. Attackers supplying a crafted n_seq_max value through a malicious model file or direct JNI call can trigger this corruption, enabling denial of service or, if executed in the context of the application, arbitrary code execution.

Affected Systems

Products from ggml-org:llama.cpp, specifically builds b1886 through b7445, are impacted. Any Android application that loads llama.cpp via the LLaMA-Android binding and accepts externally supplied model files or n_seq_max values may be vulnerable.

Risk and Exploitability

The CVSS score of 8.5 indicates a high severity, but the EPSS score is not available, making precise exploitation likelihood undetermined. The vulnerability is not listed in the CISA KEV catalog. Attackers can exploit this vulnerability if they can provide a controlled n_seq_max value, implying the attack vector is local to the application through malicious model files or an API call. Successful exploitation could lead to heap corruption, resulting in program crashes or code execution depending on the target environment.

Generated by OpenCVE AI on August 7, 2026 at 01:15 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update to the latest llama.cpp release (b7446 or newer) which includes the integer overflow fix in new_1batch().
  • Modify the LLaMA-Android JNI wrapper to validate or limit the n_seq_max parameter; enforce a maximum value or reject out-of-range inputs.
  • Secure the model file input pipeline by verifying signatures or integrity checks to prevent malicious model files from supplying crafted n_seq_max values.

Generated by OpenCVE AI on August 7, 2026 at 01:15 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 07 Aug 2026 02:15:00 +0000

Type Values Removed Values Added
First Time appeared Ggml-org
Ggml-org llama.cpp
Vendors & Products Ggml-org
Ggml-org llama.cpp

Thu, 06 Aug 2026 22:15:00 +0000

Type Values Removed Values Added
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.
Title llama.cpp b1886–b7445 Integer Overflow via new_1batch() in llama-android.cpp
Weaknesses CWE-122
CWE-190
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.5, 'vector': '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'}


Subscriptions

Ggml-org Llama.cpp
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-06T15:46:53.865Z

Reserved: 2026-08-04T20:17:18.298Z

Link: CVE-2026-70638

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-07T02:00:06Z

Weaknesses
  • CWE-122

    Heap-based Buffer Overflow

  • CWE-190

    Integer Overflow or Wraparound