highCVSS 7NVD status: Analyzed

CVE-2026-70640

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

Componentllama.cpp
Severityhigh (CVSS 7)
CVSS vectorCVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
Published (NVD)2026-08-06
Last modified2026-09-21
Affected versions
llama.cpp >= b1886, <= b7445
Fixed insee the vendor advisory
WeaknessCWE-362CWE-476
CISA KEVnot listed

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

Does CVE-2026-70640 hit the version you run?Paste your docker-compose.yml, requirements.txt or package.json. The scanner checks your pinned versions against this CVE and every other one we track for llama.cpp.
Check my stack

What to do

  • NVD lists no fixed version yet: follow the vendor advisory below and keep llama.cpp off the public internet until a fix ships.
  • Do not expose the component's API or UI to the internet without authentication in front of it.

Sources

Other llama.cpp CVEs

All llama.cpp CVEs