CVE-2026-70640: CWE-476 NULL Pointer Dereference in ggml-org llama.cpp
A race condition use-after-free vulnerability exists in llama.cpp builds b1886 through 0.9.0 in the LLaMA-Android JNI wrapper. The functions bench_1model() and free_1context() lack synchronization, allowing concurrent access to freed memory. This can be exploited by attackers to hijack a vtable pointer, leading to arbitrary memory dereference and potential remote code execution. The vulnerability has a CVSS 4.0 score of 7.3, indicating high severity. No official patch or remediation guidance is currently available.
AI Analysis
Technical Summary
llama.cpp versions b1886 and 0.9.0 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI wrapper. The lack of synchronization between bench_1model() and free_1context() allows Thread A to operate on memory freed by Thread B concurrently. Attackers can exploit this by performing a heap spray with attacker-controlled data containing a fake vtable to hijack the vtable pointer at offset +0x30. This causes llama_batch_allocr::clear() to dereference arbitrary memory, enabling remote code execution.
Potential Impact
Successful exploitation allows an attacker to achieve remote code execution by hijacking the vtable pointer and causing arbitrary memory dereference. This can compromise the affected system running vulnerable versions of llama.cpp, potentially leading to full system compromise or unauthorized code execution within the context of the application.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid running vulnerable versions b1886 and 0.9.0 of llama.cpp in environments where untrusted input can trigger the JNI wrapper. Monitor vendor channels for updates and apply patches promptly once released.
CVE-2026-70640: CWE-476 NULL Pointer Dereference in ggml-org llama.cpp
Description
A race condition use-after-free vulnerability exists in llama.cpp builds b1886 through 0.9.0 in the LLaMA-Android JNI wrapper. The functions bench_1model() and free_1context() lack synchronization, allowing concurrent access to freed memory. This can be exploited by attackers to hijack a vtable pointer, leading to arbitrary memory dereference and potential remote code execution. The vulnerability has a CVSS 4.0 score of 7.3, indicating high severity. No official patch or remediation guidance is currently available.
CVSS v4.0
Score 7.3high
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
llama.cpp versions b1886 and 0.9.0 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI wrapper. The lack of synchronization between bench_1model() and free_1context() allows Thread A to operate on memory freed by Thread B concurrently. Attackers can exploit this by performing a heap spray with attacker-controlled data containing a fake vtable to hijack the vtable pointer at offset +0x30. This causes llama_batch_allocr::clear() to dereference arbitrary memory, enabling remote code execution.
Potential Impact
Successful exploitation allows an attacker to achieve remote code execution by hijacking the vtable pointer and causing arbitrary memory dereference. This can compromise the affected system running vulnerable versions of llama.cpp, potentially leading to full system compromise or unauthorized code execution within the context of the application.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid running vulnerable versions b1886 and 0.9.0 of llama.cpp in environments where untrusted input can trigger the JNI wrapper. Monitor vendor channels for updates and apply patches promptly once released.
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: 6a75070dbf8831d5395f5c7b
Added to database: 08/06/2026, 22:13:33 UTC
Last enriched: 08/06/2026, 22:26:55 UTC
Last updated: 08/07/2026, 02:25:30 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.