{"affected":[{"defaultStatus":"unaffected","product":"llama.cpp","source":"CNA: VulnCheck","vendor":"ggml-org","versions":[{"lessThanOrEqual":"b7445","status":"affected","version":"b1886","versionType":"custom"},{"status":"unaffected","version":"5c0d18881e0e9794c96b2602736b758bac9d9388","versionType":"git"}]}],"cveId":"CVE-2026-70640","cwes":["CWE-476","CWE-362"],"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.","epss":{"date":"2026-11-08","percentile":0.15169,"score":0.0024},"exploits":[],"kev":null,"metrics":[{"score":7.3,"severity":"high","source":"CNA: VulnCheck","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","version":"4.0"},{"score":7,"severity":"high","source":"CNA: VulnCheck","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"}],"modifiedAt":1794146913530,"publishedAt":1786030702994,"references":[{"source":"CNA: VulnCheck","tags":["release-notes"],"url":"https://github.com/ggml-org/llama.cpp/releases/tag/b7446"},{"source":"CNA: VulnCheck","tags":["patch"],"url":"https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388"},{"source":"CNA: VulnCheck","tags":["related"],"url":"https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches"},{"source":"CNA: VulnCheck","tags":["third-party-advisory"],"url":"https://www.vulncheck.com/advisories/llama-cpp-b1886-b7445-race-condition-use-after-free-via-llama-android-cpp"}],"remediation":[{"kind":"fix","source":"CNA: VulnCheck","text":"The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches.","url":"https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388"}],"revision":"f4422e88794c1206eb79e2f2c89dfdd66a533d422151182a143cc7b8eddae8c6","sources":[{"modifiedAt":1794146913530,"name":"CNA: VulnCheck","retrievedAt":1794151324171,"url":"https://www.cve.org/CVERecord?id=CVE-2026-70640"},{"modifiedAt":null,"name":"FIRST EPSS","retrievedAt":1794151338125,"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-70640"}],"ssvc":{"assessedAt":1786119509875,"automatable":"no","exploitation":"none","source":"ADP: CISA-ADP","technicalImpact":"total"},"status":"published","title":"llama.cpp b1886–b7445 Race Condition Use-After-Free via llama-android.cpp","updatedAt":1794151338125}