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

Status: published. Published: 2026-08-06. Updated: 2026-11-08.

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.

## Remediation

- fix: The reporting source identifies this reference as a patch. Check the advisory for affected versions and supported release branches. (source: CNA: VulnCheck) — https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388

## Affected products and versions

- ggml-org / llama.cpp: ≥ b1886; ≤ b7445 (affected, custom); 5c0d18881e0e9794c96b2602736b758bac9d9388 (unaffected, git). Source: CNA: VulnCheck

## Severity and prioritization

- 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; source: CNA: VulnCheck

- CVSS 3.1: 7 (high); CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H; source: CNA: VulnCheck

- CISA KEV: No listing in collected sources

- EPSS: 0.24% as of 2026-11-08; percentile 15.17%

- SSVC: exploitation none; automatable no; technical impact total; source ADP: CISA-ADP

- Weaknesses: CWE-476, CWE-362

## Exploit evidence

No exploit evidence in collected sources. This is not proof of no exploitation.

## References

- https://github.com/ggml-org/llama.cpp/releases/tag/b7446 (CNA: VulnCheck; release-notes)

- https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388 (CNA: VulnCheck; patch)

- https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches (CNA: VulnCheck; related)

- https://www.vulncheck.com/advisories/llama-cpp-b1886-b7445-race-condition-use-after-free-via-llama-android-cpp (CNA: VulnCheck; third-party-advisory)

## Provenance

- CNA: VulnCheck: https://www.cve.org/CVERecord?id=CVE-2026-70640; retrieved 2026-11-08; source updated 2026-11-08

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-70640; retrieved 2026-11-08; source updated Not reported

Revision: f4422e88794c1206eb79e2f2c89dfdd66a533d422151182a143cc7b8eddae8c6

Canonical: https://y2.dev/cve/CVE-2026-70640

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.