Race Condition Use-After-Free Vulnerability in LLaMA-Android JNI Wrapper by ggml-org
CVE-2026-70640
7.3HIGH
What is CVE-2026-70640?
The LLaMA-Android JNI wrapper in llama.cpp builds b1886 through b7445 suffers from a race condition use-after-free vulnerability. This issue arises because of a lack of synchronization between the functions bench_1model() and free_1context(), permitting concurrent memory access. An attacker can exploit this vulnerability by conducting a heap spray with specially crafted data, targeting the vtable pointer. This allows for arbitrary memory dereferencing during the operation of llama_batch_allocr::clear(), ultimately leading to remote code execution and system compromise.
Affected Version(s)
llama.cpp b1886
llama.cpp 0.9.0 <= 0.17.1
llama.cpp 5c0d18881e0e9794c96b2602736b758bac9d9388
References
CVSS V4
Score:
7.3
Severity:
HIGH
Confidentiality:
High
Integrity:
High
Availability:
High
Attack Vector:
Local
Attack Complexity:
High
Attack Required:
None
Privileges Required:
Undefined
User Interaction:
Unknown
Timeline
Vulnerability published
Vulnerability Reserved
Credit
Vladimir Tokarev (@G1ND1L4) - Vulnerability Research Tech Lead, Cyera
Ofek Itach (@ofekitach) - Security Research Team Lead, Cyera
