CVE-2026-70640: NULL Pointer Dereference in ggml-org llama.cpp
llama.cpp builds b1886 through b7445 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI wrapper where bench_1model() and free_1context() lack synchronization, allowing Thread A to operate on freed memory while Thread B concurrently frees the llama_context. Attackers can exploit this by performing heap spray with attacker-controlled data containing a fake vtable to hijack the vtable pointer at offset +0x30, causing llama_batch_allocr::clear() to dereference arbitrary memory and achieve remote code execution.
AI Analysis
Technical Summary
llama.cpp versions including build b1886 through b7445 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI wrapper. Specifically, the functions bench_1model() and free_1context() do not synchronize access to the llama_context, allowing Thread A to operate on memory that Thread B has freed. An attacker can exploit this by performing a heap spray with crafted data containing a fake vtable pointer at offset +0x30. This causes the llama_batch_allocr::clear() function to dereference arbitrary memory, potentially enabling remote code execution.
Potential Impact
Exploitation of this vulnerability can lead to remote code execution on affected systems due to the ability to hijack the vtable pointer and cause arbitrary memory dereference. This can compromise the confidentiality, integrity, and availability of the affected application.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or temporary mitigation has been documented at this time.
CVE-2026-70640: NULL Pointer Dereference in ggml-org llama.cpp
Description
llama.cpp builds b1886 through b7445 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI wrapper where bench_1model() and free_1context() lack synchronization, allowing Thread A to operate on freed memory while Thread B concurrently frees the llama_context. Attackers can exploit this by performing heap spray with attacker-controlled data containing a fake vtable to hijack the vtable pointer at offset +0x30, causing llama_batch_allocr::clear() to dereference arbitrary memory and achieve remote code execution.
CVSS v4.0
Score 7.3high
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 including build b1886 through b7445 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI wrapper. Specifically, the functions bench_1model() and free_1context() do not synchronize access to the llama_context, allowing Thread A to operate on memory that Thread B has freed. An attacker can exploit this by performing a heap spray with crafted data containing a fake vtable pointer at offset +0x30. This causes the llama_batch_allocr::clear() function to dereference arbitrary memory, potentially enabling remote code execution.
Potential Impact
Exploitation of this vulnerability can lead to remote code execution on affected systems due to the ability to hijack the vtable pointer and cause arbitrary memory dereference. This can compromise the confidentiality, integrity, and availability of the affected application.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or temporary mitigation has been documented at this time.
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: 6a75070dbf8831d5395f5c7b
Added to database: 08/06/2026, 22:13:33 UTC
Last enriched: 08/14/2026, 15:55:13 UTC
Last updated: 09/21/2026, 22:01:37 UTC
Views: 81
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.