CVE-2026-70638: CWE-190 Integer Overflow or Wraparound in ggml-org llama.cpp
An integer overflow vulnerability exists in llama.cpp builds b1886 through 0.9.0 in the LLaMA-Android JNI wrapper. The new_1batch() function multiplies sizeof(llama_seq_id) by an attacker-controlled n_seq_max parameter without validating for overflow, causing heap buffer allocation to wrap and allocate insufficient memory. This can lead to heap corruption, potentially allowing denial of service or arbitrary code execution on Android applications using this binding.
AI Analysis
Technical Summary
The vulnerability in llama.cpp (builds b1886 through 0.9.0) involves an integer overflow in the LLaMA-Android JNI wrapper's new_1batch() function. Specifically, the function multiplies sizeof(llama_seq_id) by the n_seq_max parameter, which is attacker-controlled, without checking for overflow. This results in heap buffer allocation wrapping around and allocating less memory than required. An attacker can exploit this by supplying a crafted n_seq_max value via a malicious model file or JNI call, causing heap corruption that may lead to denial of service or arbitrary code execution on affected Android applications.
Potential Impact
Successful exploitation can cause heap corruption due to insufficient memory allocation, leading to denial of service or arbitrary code execution on Android applications using the vulnerable LLaMA-Android JNI wrapper. The CVSS 4.0 score is 8.5 (high severity), reflecting the potential for significant impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch links are currently available. Until a patch is released, avoid using affected versions or restrict usage of untrusted model files or JNI calls that could supply malicious n_seq_max values.
CVE-2026-70638: CWE-190 Integer Overflow or Wraparound in ggml-org llama.cpp
Description
An integer overflow vulnerability exists in llama.cpp builds b1886 through 0.9.0 in the LLaMA-Android JNI wrapper. The new_1batch() function multiplies sizeof(llama_seq_id) by an attacker-controlled n_seq_max parameter without validating for overflow, causing heap buffer allocation to wrap and allocate insufficient memory. This can lead to heap corruption, potentially allowing denial of service or arbitrary code execution on Android applications using this binding.
CVSS v4.0
Score 8.5high
Affected software
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
The vulnerability in llama.cpp (builds b1886 through 0.9.0) involves an integer overflow in the LLaMA-Android JNI wrapper's new_1batch() function. Specifically, the function multiplies sizeof(llama_seq_id) by the n_seq_max parameter, which is attacker-controlled, without checking for overflow. This results in heap buffer allocation wrapping around and allocating less memory than required. An attacker can exploit this by supplying a crafted n_seq_max value via a malicious model file or JNI call, causing heap corruption that may lead to denial of service or arbitrary code execution on affected Android applications.
Potential Impact
Successful exploitation can cause heap corruption due to insufficient memory allocation, leading to denial of service or arbitrary code execution on Android applications using the vulnerable LLaMA-Android JNI wrapper. The CVSS 4.0 score is 8.5 (high severity), reflecting the potential for significant impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch links are currently available. Until a patch is released, avoid using affected versions or restrict usage of untrusted model files or JNI calls that could supply malicious n_seq_max values.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-04T20:17:18.298Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a75070dbf8831d5395f5c71
Added to database: 08/06/2026, 22:13:33 UTC
Last enriched: 08/06/2026, 22:27:01 UTC
Last updated: 08/07/2026, 00:40:28 UTC
Views: 4
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.