Skip to content
HighVulnerabilityLLM-specific

CVE-2026-70640: llama.cpp use-after-free in the LLaMA-Android JNI wrapper enables code execution

Identifier
CVE-2026-70640
Published
Record updated
View JSON
Fixed in
The source references a patch, a mitigation or a vendor advisory.

Summary

llama.cpp builds b1886 through b7445 contain a race condition use-after-free in the LLaMA-Android JNI wrapper, where bench_1model() and free_1context() lack synchronization. Thread A can operate on memory that Thread B has already freed from the llama_context. An attacker can exploit this through heap spraying with attacker-controlled data containing a fake vtable, hijacking the vtable pointer at offset +0x30 so that llama_batch_allocr::clear() dereferences arbitrary memory and achieves remote code execution.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.