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.
{
"cna_assigner": "VulnCheck",
"cwe_ids": [
"CWE-362",
"CWE-476"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/70xxx/CVE-2026-70640.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-70640.json"
[
{
"deprecated": false,
"digest": {
"line_hashes": [
"334411191698948442196723930483104454060",
"37366638444284429051614071922669106979",
"139232692773709095660313632590427735062",
"5259375327948776342389338159184170899"
],
"threshold": 0.9
},
"id": "CVE-2026-70640-09f5f06e",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/ggml-org/llama.cpp/commit/4b2a4778f81f222c12271ce3b1997990b3071faf",
"target": {
"file": "common/arg.cpp"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "337343721808502297225290834391498754494",
"length": 106923
},
"id": "CVE-2026-70640-8e669eb6",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/ggml-org/llama.cpp/commit/4b2a4778f81f222c12271ce3b1997990b3071faf",
"target": {
"file": "common/arg.cpp",
"function": "common_params_parser_init"
}
}
]
"2026-09-02T08:08:02Z"