SA-26-485 High

llama.cpp: Llama.cpp builds b1886 through b7445 contain a race condition use-after-free vulnerability in…

llama.cpp

Severity
High, CVSS 7.0
CVSS vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
Record
CVE-2026-70640
Affects
llama.cpp
Known exploited
Not listed in the CISA Known Exploited Vulnerabilities catalog
Published
Record first published by the source
August 6, 2026
Source last modified
October 24, 2026

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.

Description quoted from the NVD record.

Who is affected

This problem affects llama.cpp, made by ggml, which is software for running AI language models on your own devices. The flaw affects builds b1886 through b7445, in the part that lets Android apps use llama.cpp. Two tasks inside that part can run at the same time without waiting for each other, so one can keep using memory after the other has already released it. An attacker could take advantage of this to run their own code on the device. This flaw is rated High.

What to do

  1. The person who builds or installs llama.cpp in your organization, or the developer of any Android app that includes it, should check whether a build from b1886 through b7445 is in use.
  2. If no one in your organization uses llama.cpp inside an Android app, this flaw does not affect you.
  3. No fixed version is named for this flaw yet, so check the vendor advisory linked on this page for a fixed release and install it as soon as it is available.
  4. If an IT provider or app developer manages llama.cpp or the Android app for your organization, send them this advisory and ask when the update will be done.

Analysis written from the source record as of October 24, 2026 and reviewed before publishing.

Sources

MORE ADVISORIES

See all