CVE-2026-70638: Integer Overflow or Wraparound in ggml-org llama.cpp
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.
AI Analysis
Technical Summary
llama.cpp versions b1886 through 0.9.0 contain an integer overflow vulnerability in the LLaMA-Android JNI wrapper. Specifically, the new_1batch() function multiplies sizeof(llama_seq_id) by the n_seq_max parameter, which is attacker-controlled, without checking for overflow. This results in a heap buffer allocation wraparound, causing insufficient memory allocation. An attacker can exploit this by supplying a crafted n_seq_max value via a malicious model file or JNI call, triggering heap corruption that may lead to denial of service or arbitrary code execution on affected Android applications.
Potential Impact
Exploitation of this vulnerability can cause heap corruption due to insufficient memory allocation, potentially resulting in denial of service or arbitrary code execution on Android applications using the vulnerable LLaMA-Android JNI wrapper. No known exploits in the wild have been reported.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a patch is available, avoid processing untrusted model files or JNI calls that could supply malicious n_seq_max values to the LLaMA-Android binding.
CVE-2026-70638: Integer Overflow or Wraparound in ggml-org llama.cpp
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 v4.0
Score 8.5high
Affected software
ggml-org
llama.cpp
pkg:github/ggml-org/llama.cppRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
llama.cpp versions b1886 through 0.9.0 contain an integer overflow vulnerability in the LLaMA-Android JNI wrapper. Specifically, the new_1batch() function multiplies sizeof(llama_seq_id) by the n_seq_max parameter, which is attacker-controlled, without checking for overflow. This results in a heap buffer allocation wraparound, causing insufficient memory allocation. An attacker can exploit this by supplying a crafted n_seq_max value via a malicious model file or JNI call, triggering heap corruption that may lead to denial of service or arbitrary code execution on affected Android applications.
Potential Impact
Exploitation of this vulnerability can cause heap corruption due to insufficient memory allocation, potentially resulting in denial of service or arbitrary code execution on Android applications using the vulnerable LLaMA-Android JNI wrapper. No known exploits in the wild have been reported.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a patch is available, avoid processing untrusted model files or JNI calls that could supply malicious n_seq_max values to the LLaMA-Android binding.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-04T20:17:18.298Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a75070dbf8831d5395f5c71
Added to database: 08/06/2026, 22:13:33 UTC
Last enriched: 08/14/2026, 15:54:58 UTC
Last updated: 09/21/2026, 22:01:37 UTC
Views: 40
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.