Impact
This vulnerability is a race condition use‑after‑free in the LLaMA‑Android JNI wrapper of llama.cpp between builds b1886 and b7445. The absence of synchronization between the bench_1model() routine and the free_1context() call allows one thread to free a llama_context while another thread continues to access it. An attacker can exploit the freed memory by performing a heap spray that injects a forged vtable; the subsequent llama_batch_allocr::clear() call dereferences the malicious vtable pointer at offset +0x30, enabling arbitrary code execution.
Affected Systems
The affected product is ggml‑org:llama.cpp builds b1886 through b7445. Versions earlier than the release tagged b7446 contain the flaw; the patch commit is identified by hash 5c0d18881e0e9794c96b2602736b758bac9d9388. Users running any of these builds that expose the JNI for benchmark or freeing operations are at risk.
Risk and Exploitability
The CVSS score of 7.3 indicates a high impact if the flaw is exploited. No EPSS score is available, so exploitation likelihood cannot be quantified at this time. The vulnerability is not listed in the CISA KEV catalog, implying no publicly known exploit has yet been documented. Attackers would need to trigger the race condition, typically via concurrent JNI invocations, and construct a heap spray with a fake vtable to hijack execution. This requires some code execution capability, so the attack is likely confined to scenarios where the affected binary is invoked with user‑controlled input.
OpenCVE Enrichment