{"id":"CVE-2026-70640","revision":"d12548ce41bf4f528850a7098ac92c1f","records":[{"revision":"d12548ce41bf4f528850a7098ac92c1f","observedAt":"2026-10-29T21:48:56.968+00:00","statement":{"source":"cve-program","id":"CVE-2026-70640","aliases":[],"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.","state":0,"publishedAt":"2026-08-06T15:38:22.994+00:00","modifiedAt":"2026-10-29T20:20:03.21+00:00","affected":[{"ecosystem":"Vendor product","name":"llama.cpp","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"ggml-org\",\n                    \"product\": \"llama.cpp\",\n                    \"versions\": [\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"b1886\",\n                            \"lessThanOrEqual\": \"b7445\",\n                            \"versionType\": \"custom\"\n                        },\n                        {\n                            \"status\": \"unaffected\",\n                            \"version\": \"5c0d18881e0e9794c96b2602736b758bac9d9388\",\n                            \"versionType\": \"git\"\n                        }\n                    ],\n                    \"defaultStatus\": \"unaffected\"\n                }"}],"metrics":[{"system":"CVSS 4.0","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","score":7.3,"severity":"HIGH"},{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7,"severity":"HIGH"}],"references":["https://github.com/ggml-org/llama.cpp/releases/tag/b7446","https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388","https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches","https://www.vulncheck.com/advisories/llama-cpp-b1886-b7445-race-condition-use-after-free-via-llama-android-cpp"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-70640","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-70640","identifiers":["CVE-2026-70640"]},"retained":false,"historicalAffected":[]}],"coverage":[]}