# CVE-2026-70640: llama.cpp b1886–b7445 Race Condition Use-After-Free via llama-android.cpp

- Severity: High 7.3 (CVSS:4.0, scored by VulnCheck) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.30%, higher than 24% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-08-06T15:38:22.994Z
- Modified: 2026-11-13T22:17:25.807Z
- Weaknesses: CWE-362, CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: VulnCheck

## 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.

(As written by CVE List.)

## Affected

- ggml-org llama.cpp: from b1886 up to b7445 (not affected: 5c0d18881e0e9794c96b2602736b758bac9d9388)
- ggml llama.cpp: from b1886 up to b7445

## Every score

- VulnCheck: CVSS:4.0 7.3 High `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`
- VulnCheck: CVSS:3.1 7.0 High `CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://www.vulncheck.com/advisories/llama-cpp-b1886-b7445-race-condition-use-after-free-via-llama-android-cpp> (exploit, third-party-advisory)
- <https://github.com/ggml-org/llama.cpp/releases/tag/b7446> (patch, release-notes, vendor-advisory)
- <https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388> (patch)
- <https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches> (patch, related, third-party-advisory)
- <https://www.youtube.com/watch?v=_FKX5hDwgVE&t=1079s>
- <https://www.cyera.com/research/breaking-local-ai-runtimes-10-vulnerabilities-in-the-engine-behind-your-open-source-models>

## Sources

- CVE List: [CVE-2026-70640](https://www.cve.org/CVERecord?id=CVE-2026-70640), CVE Terms of Use, modified 2026-11-13
- NVD: [CVE-2026-70640](https://nvd.nist.gov/vuln/detail/CVE-2026-70640), Public domain, modified 2026-11-13

---

Page: https://cve.day/CVE-2026-70640 · Whole record: https://cve.day/CVE-2026-70640.json · Rebuilt by cve.day 2026-11-25T22:59:31.802Z
