CVE-2026-70638 Details
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.
An integer overflow vulnerability has been identified in llama.cpp versions b1886 through b7445, specifically within the LLaMA-Android JNI wrapper. The issue arises in the new_1batch() function, where the size of llama_seq_id is multiplied by an attacker-controlled n_seq_max parameter without proper overflow validation. This flaw leads to heap buffer allocation errors, allowing attackers to cause heap corruption and potentially execute arbitrary code or disrupt service in Android applications that use the LLaMA-Android binding.
Users can apply the patch available in the 'llama.cpp-security-patches' repository by following the instructions provided in the repository's 'Applying Patches' section.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Aug 7, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388 | [email protected] | Patch |
| https://github.com/ggml-org/llama.cpp/releases/tag/b7446 | [email protected] | PatchRelease NotesVendor Advisory |
| https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches | [email protected] | PatchThird Party Advisory |
| https://www.vulncheck.com/advisories/llama-cpp-b1886-b7445-integer-overflow-via-new-1batch-in-llama-android-cpp | [email protected] | Third Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-122 | Heap-based Buffer Overflow | [email protected] |
| CWE-190 | Integer Overflow or Wraparound | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| ggml llama.cpp | >= b1886, <= b7445 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Sep 21, 2026 | Initial Analysis | [email protected] |
| Aug 7, 2026 | CVE Modified | [email protected] |
| Aug 7, 2026 | CVE Modified | CISA-ADP |
| Aug 6, 2026 | New CVE Received | [email protected] |