Skip to main content

llama.cpp EUVDEUVD-2026-54096

| CVE-2026-43622 HIGH
Mismatched Memory Management Routines (CWE-762)
2026-08-06 VulnCheck GHSA-54rv-j2gm-hqfc
8.5
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    User launches Android app with vulnerable llama.cpp JNI wrapper
  2. Delivery
    Attacker-influenced inference input triggers new_1batch() via JNI
  3. Exploit
    Memory block allocated with malloc()
  4. Execution
    free_1batch() invoked with C++ delete on malloc() pointer
  5. Persist
    Heap metadata corruption
  6. Impact
    Process 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

llama.cpp patch: 5c0d18881e0e9794c96b2602736b758bac9d9388
llama.cpp b1886 ≤b7445
llama.cpp 0.9.0 ≤0.17.1

Affected Packages

euvd llama_cpp no fix

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

Vendor (VulnCheck) PRIMARY 8.5 HIGH
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
vuln.today AI 7.8 HIGH

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.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE HIGH

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
Medium
popular open-source LLM inference engine; Android JNI component more niche
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

CVE-2024-42479 CRITICAL POC
10.0 Aug 12

Arbitrary memory write in llama.cpp's RPC server allows remote unauthenticated attackers to corrupt arbitrary memory add

CVE-2024-21802 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) is possible when a user opens a malicious .gguf model file, triggeri

CVE-2026-21869 HIGH POC
8.8 Jan 08

Llama.cpp server endpoints fail to validate the n_discard parameter from JSON input, allowing negative values that trigg

CVE-2024-21825 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) is possible when a victim loads a malicious .gguf model file, trigge

CVE-2024-23605 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (GGUF library) allows attackers to achieve arbitrary code execution by tricking a use

CVE-2024-23496 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) occurs when the GGUF library's gguf_fread_str function parses a mali

CVE-2024-21836 HIGH POC
8.8 Feb 26

Heap-based buffer overflow in llama.cpp's GGUF library header parser (commit 18c2e17) enables code execution when a vict

CVE-2025-52566 HIGH POC
8.6 Jun 24

CVE-2025-52566 is a signed vs. unsigned integer overflow vulnerability in llama.cpp's tokenizer (llama_vocab::tokenize f

CVE-2026-34159 CRITICAL
9.8 Apr 01

Remote code execution in llama.cpp RPC backend allows unauthenticated attackers with TCP access to achieve arbitrary mem

CVE-2024-42478 MEDIUM POC
5.3 Aug 12

llama.cpp provides LLM inference in C/C++. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable,

CVE-2026-43629 CRITICAL
9.2 Aug 06

Heap buffer overflow in llama.cpp's server KV cache state-restore path (builds b4882 through b9058) lets an attacker who

CVE-2026-43631 CRITICAL
9.2 Aug 06

Remote code execution in llama.cpp's llama-server (builds b7492 through b9060) allows unauthenticated attackers to run a

Vendor StatusVendor

SUSE

Severity: Important

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy