{"id":"CVE-2026-70640","aliases":["CVE-2026-70640"],"related":[],"kind":"vulnerability","state":"published","title":"llama.cpp b1886–b7445 Race Condition Use-After-Free via llama-android.cpp","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"Las versiones b1886 a b7445 de llama.cpp contienen una vulnerabilidad de uso después de liberación por condición de carrera en el envoltorio JNI de LLaMA-Android donde bench_1model() y free_1context() carecen de sincronización, permitiendo que el Hilo A opere sobre memoria liberada mientras el Hilo B libera concurrentemente el llama_context. Los atacantes pueden explotar esto realizando una pulverización de heap con datos controlados por el atacante que contengan una vtable falsa para secuestrar el puntero de vtable en el desplazamiento +0x30, haciendo que llama_batch_allocr::clear() desreferencie memoria arbitraria y logre la ejecución remota de código.","source":"nvd"}],"published":"2026-08-06T15:38:22.994Z","modified":"2026-11-13T22:17:25.807Z","severity":{"scorer":"VulnCheck","scheme":"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,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"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,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"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,"rating":"HIGH"}],"cwes":["CWE-362","CWE-476"],"affected":[{"ranges":[{"type":"custom","introduced":"b1886","lastAffected":"b7445","status":"affected"},{"type":"git","version":"5c0d18881e0e9794c96b2602736b758bac9d9388","status":"unaffected"}],"vendor":"ggml-org","product":"llama.cpp","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"b1886","lastAffected":"b7445"}],"vendor":"ggml","product":"llama.cpp","cpe":"cpe:2.3:a:ggml:llama.cpp:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/ggml-org/llama.cpp/releases/tag/b7446","tags":["patch","release-notes","vendor-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches","tags":["patch","related","third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://www.vulncheck.com/advisories/llama-cpp-b1886-b7445-race-condition-use-after-free-via-llama-android-cpp","tags":["exploit","third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://www.youtube.com/watch?v=_FKX5hDwgVE&t=1079s","tags":[],"sources":["cvelist","nvd"]},{"url":"https://www.cyera.com/research/breaking-local-ai-runtimes-10-vulnerabilities-in-the-engine-behind-your-open-source-models","tags":[],"sources":["cvelist","nvd"]}],"credits":["Vladimir Tokarev (@G1ND1L4) - Vulnerability Research Tech Lead, Cyera","Ofek Itach (@ofekitach) - Security Research Team Lead, Cyera"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-08-07T16:18:29.875Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-70640","url":"https://www.cve.org/CVERecord?id=CVE-2026-70640","licence":"CVE Terms of Use","modified":"2026-11-13T21:26:51.973Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-70640","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-70640","licence":"Public domain","modified":"2026-11-13T22:17:25.807Z"}],"updatedAt":"2026-11-25T22:59:31.802Z","epss":{"score":0.00299,"percentile":0.24303,"date":"2026-12-01T12:00:22.000Z"}}