Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUser launches Android app with vulnerable llama.cpp JNI wrapper
-
DeliveryAttacker-influenced inference input triggers new_1batch() via JNI
-
ExploitMemory block allocated with malloc()
-
Executionfree_1batch() invoked with C++ delete on malloc() pointer
-
PersistHeap metadata corruption
-
ImpactProcess crash (DoS) or heap exploitation enabling in-process code execution
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory management consistency
|
| Exploitation Conditions | Exploitation requires the target Android application to use llama.cpp builds b1886 through b7445 and to invoke the LLaMA-Android JNI wrapper's batch allocation lifecycle through the new_1batch() and free_1batch() functions. The CVSS 4.0 UI:P metric indicates the victim must take an action - likely launching the app or initiating an inference session - to trigger the vulnerable code path. The AV:L (local) vector limits exploitation to the local device context; network-based remote triggering is not indicated by available data. Arbitrary code execution beyond a reliable crash is further conditioned on favorable allocator state, which varies by Android version and device model. Exploitation is bounded by: the requirement for an Android application specifically using the JNI wrapper (not desktop or server llama.cpp builds), the build range b1886-b7445, and the necessity of reaching the batch allocation path via attacker-influenced input. Non-Android deployments of llama.cpp are not affected by this specific vulnerability. |
| Impact | The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:P, score 8.5) indicates a local attack surface with low complexity, no privileges required, but user interaction present - meaning exploitation requires an end user to run an Android application that exercises the vulnerable JNI batch allocation path. The high impact ratings (VC:H/VI:H/VA:H) reflect the theoretical ceiling of arbitrary code execution; in practice, reliable heap exploitation beyond a process crash depends on allocator internals and heap layout, which vary significantly across Android versions and devices. No EPSS probability score was provided in the available intelligence, so quantitative exploitation likelihood cannot be stated. The vulnerability is not listed in CISA KEV and no confirmed public proof-of-concept exploit has been identified, meaningfully reducing near-term real-world risk. The local attack vector further constrains the attacker population to those who can influence input within the device context. Overall this is a medium operational priority: a real, well-characterized vulnerability with credible RCE potential capped by local-only access, absence of known active exploitation, and availability of a vendor-released fix. |
| Exploit ScenarioDerived | An attacker who can supply a crafted prompt or model interaction to an Android application embedding the vulnerable llama.cpp JNI wrapper triggers the new_1batch() and free_1batch() call sequence, causing the C++ delete operator to corrupt heap metadata set up by malloc(). Depending on the Android runtime heap layout and allocator state, this results in a reliable process crash (denial of service) or, with controlled heap grooming, could be leveraged for code execution within the application's sandbox. No public proof-of-concept exploit has been confirmed at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 06, 2026
Heap corruption via mismatched memory management in llama.cpp's LLaMA-Android JNI wrapper affects builds b1886 through b7445, where new_1batch() allocates memory with malloc() but free_1batch() releases it using the C++ delete operator, triggering undefined behavior and heap metadata corruption. This mismatch guarantees denial of service via process crash and, depending on allocator state, may enable arbitrary code execution within the affected Android application process. No public exploit code has been confirmed and the vulnerability is not listed in CISA KEV; a vendor-released patch exists as build b7446.
RemediationAI
Upgrade to llama.cpp build b7446 or later, available at https://github.com/ggml-org/llama.cpp/releases/tag/b7446. The upstream fix is tracked at commit 5c0d18881e0e9794c96b2602736b758bac9d9388 (https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388). Community-maintained security patches are also referenced at https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches. For Android applications that cannot immediately rebuild against a patched version, limit exposure by avoiding untrusted or externally supplied inputs to the batch inference path; this reduces the attack surface but does not eliminate the underlying memory management defect. No configuration-level workaround removes the vulnerability without rebuilding against corrected source.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CWE-762 (Mismatched Memory Management Routines) describes the root cause: in C++, memory allocated with the C-runtime malloc() must be released with free(), while memory allocated with operator new must be released with operator delete. When free_1batch() applies C++ delete to a buffer that new_1batch() provisioned via malloc(), the heap allocator's internal metadata - allocation size headers, free-list linkage, and boundary tags - becomes corrupted. This is a classic undefined behavior scenario in mixed C/C++ codebases. The affected component is the LLaMA-Android JNI (Java Native Interface) wrapper in llama.cpp, the open-source GGML-based C/C++ inference engine for quantized LLM models maintained by ggml-org. The JNI layer bridges Kotlin/Java Android application code to the native llama.cpp library. Per CPE cpe:2.3:a:ggml-org:llama.cpp:*:*:*:*:*:*:*:*, all llama.cpp builds in the range b1886 through b7445 are in scope.
Know when Llama Cpp gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Local vector and required user interaction to trigger JNI batch path; PR:N as no privilege elevation needed to invoke JNI functions; full C/I/A if heap grooming succeeds.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
llama.cpp builds b1886 through b7445 contain a double free vulnerability in the LLaMA-Android JNI wrapper where new_1batch() allocates memory using malloc() while free_1batch() deallocates it using the C++ delete operator, causing heap metadata corruption. Attackers can trigger this memory management mismatch to cause denial of service through process crashes or potentially achieve arbitrary code execution depending on allocator state.
Executive ViewAI
Heap corruption vulnerability in llama.cpp LLaMA-Android JNI wrapper (builds b1886-b7445) guarantees denial of service against any Android application using the affected library, with potential arbitrary code execution depending on allocator state. Organizations operating mobile applications leveraging llama.cpp must identify and remediate affected builds immediately, as process crashes will degrade user experience and breach application availability commitments.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Arbitrary memory write in llama.cpp's RPC server allows remote unauthenticated attackers to corrupt arbitrary memory add
Remote code execution in llama.cpp (commit 18c2e17) is possible when a user opens a malicious .gguf model file, triggeri
Llama.cpp server endpoints fail to validate the n_discard parameter from JSON input, allowing negative values that trigg
Remote code execution in llama.cpp (commit 18c2e17) is possible when a victim loads a malicious .gguf model file, trigge
Remote code execution in llama.cpp (GGUF library) allows attackers to achieve arbitrary code execution by tricking a use
Remote code execution in llama.cpp (commit 18c2e17) occurs when the GGUF library's gguf_fread_str function parses a mali
Heap-based buffer overflow in llama.cpp's GGUF library header parser (commit 18c2e17) enables code execution when a vict
CVE-2025-52566 is a signed vs. unsigned integer overflow vulnerability in llama.cpp's tokenizer (llama_vocab::tokenize f
Remote code execution in llama.cpp RPC backend allows unauthenticated attackers with TCP access to achieve arbitrary mem
llama.cpp provides LLM inference in C/C++. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable,
Heap buffer overflow in llama.cpp's server KV cache state-restore path (builds b4882 through b9058) lets an attacker who
Remote code execution in llama.cpp's llama-server (builds b7492 through b9060) allows unauthenticated attackers to run a
EUVD-2026-54096
GHSA-54rv-j2gm-hqfc
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB