{"id":"CVE-2026-70640","aliases":["DEBIAN-CVE-2026-70640","EUVD-2026-54280","GHSA-vfpq-2xx5-4vrv"],"status":"published","title":"llama.cpp b1886–b7445 Race Condition Use-After-Free via llama-android.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.","severity":{"version":"4.0","score":7.3,"vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.0024,"percentile":0.15226,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-362","CWE-476"],"published":"2026-08-06T15:38:22Z","modified":"2026-11-08T14:08:33Z","fixes":[{"ecosystem":"Debian:14","package":"llama.cpp","fixed_in":["7593+dfsg-1"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Debian:14","package":"llama.cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"7593+dfsg-1"}]}],"versions":["5151+dfsg-1~exp2","5151+dfsg-1~exp3","5318+dfsg-1","5318+dfsg-2","5713+dfsg-1","5760+dfsg-1","5760+dfsg-2","5760+dfsg-3","5760+dfsg-4","5882+dfsg-1","5882+dfsg-2","5882+dfsg-3","5882+dfsg-3~exp1","5882+dfsg-3~exp2","5882+dfsg-3~exp3","5882+dfsg-4","6641+dfsg-1","6641+dfsg-2","6641+dfsg-3"]}],"products":[{"vendor":"ggml","product":"llama.cpp"},{"vendor":"ggml-org","product":"llama.cpp"}],"references":[{"url":"https://github.com/ggml-org/llama.cpp/releases/tag/b7446","tags":["release-notes","Patch","Release Notes","Vendor Advisory","advisory"]},{"url":"https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388","tags":["patch","Patch","fix"]},{"url":"https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches","tags":["related","Patch","Third Party Advisory","package"]},{"url":"https://www.vulncheck.com/advisories/llama-cpp-b1886-b7445-race-condition-use-after-free-via-llama-android-cpp","tags":["third-party-advisory","Exploit","Third Party Advisory","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-70640","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-vfpq-2xx5-4vrv"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/70xxx/CVE-2026-70640.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-70640","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2026-70640","title":"llama.cpp b1886–b7445 Race Condition Use-After-Free via llama-android.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.","status":"published","published":"2026-08-06T15:38:22.994Z","modified":"2026-11-08T14:08:33.53Z","cvss":[{"version":"4.0","score":7.3,"vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high","assessor":"cna"},{"version":"3.1","score":7,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-476","CWE-362"],"updated_at":"2026-11-08T15:43:34.234229Z"}],"euvd":[{"id":"EUVD-2026-54280","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.","status":"published","published":"2026-08-06T15:38:22Z","modified":"2026-11-08T14:08:33Z","cvss":[{"version":"4.0","score":7.3,"vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"updated_at":"2026-11-08T15:13:06.469155Z"}],"ghsa":[{"id":"GHSA-vfpq-2xx5-4vrv","title":"llama.cpp builds b1886 through b7445 contain a race condition use-after-free vulnerability in the...","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.","status":"published","published":"2026-08-07T00:31:22Z","modified":"2026-08-07T21:30:32Z","cvss":[{"version":"4.0","score":7.3,"vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high"},{"version":"3.1","score":7,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-362"],"updated_at":"2026-11-02T15:10:12.306859Z"}],"nvd":[{"id":"CVE-2026-70640","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.","status":"published","published":"2026-08-06T22:18:28.927Z","modified":"2026-10-29T21:17:31.177Z","cvss":[{"version":"4.0","score":7.3,"vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high","assessor":"secondary"},{"version":"3.1","score":7,"vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"}],"cwes":["CWE-362","CWE-476"],"updated_at":"2026-11-02T14:12:35.386166Z"}],"osv":[{"id":"CVE-2026-70640","title":"llama.cpp b1886–b7445 Race Condition Use-After-Free via llama-android.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.","status":"published","published":"2026-08-06T15:38:22.994Z","modified":"2026-11-09T02:47:28.077365451Z","cvss":[{"version":"4.0","score":7.3,"vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-362","CWE-476"],"updated_at":"2026-11-09T03:16:17.543303Z"},{"id":"DEBIAN-CVE-2026-70640","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.","status":"published","published":"2026-08-06T22:18:28.927Z","modified":"2026-10-30T09:49:17.312419621Z","cvss":[{"version":"4.0","score":7.3,"vector":"CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high"}],"updated_at":"2026-11-02T15:46:02.094661Z"}]}}
