Skip to main content

llama.cpp EUVDEUVD-2026-54281

| CVE-2026-43627 HIGH
Integer Overflow or Wraparound (CWE-190)
2026-08-06 disclosure@vulncheck.com GHSA-6gxr-4p8w-gxc9
8.5
CVSS 4.0 · Vendor: vulncheck
View

Attack ChainAIDerived

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

  1. Access
    Supply crafted n_tokens/n_seq_max parameters
  2. Delivery
    Invoke llama_batch_init() in vulnerable build
  3. Exploit
    Integer overflow wraps malloc() size past INT32_MAX
  4. Execution
    Heap buffer under-allocated
  5. Persist
    Batch write operations exceed buffer boundary
  6. Impact
    Heap corruption enables arbitrary code execution

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires local access to an environment running a vulnerable llama.cpp build (b1283 through b9058 / versions 0.4.0 to 0.17.1) - the CVSS 4.0 AV:L metric confirms this is not a remote-network-reachable vulnerability in its base form. Passive user interaction is required (UI:P): the victim process must invoke llama_batch_init() with attacker-influenced parameter values, meaning the attacker must control or influence the n_tokens or n_seq_max arguments - achievable via malicious model files, crafted API inputs to an inference server accepting external requests, or direct local code execution. No elevated privileges are required (PR:N); standard user-level execution of a llama.cpp-backed application suffices. Exploitation is NOT possible against systems running builds earlier than b1283 or later than b9058, nor against semantic versions outside 0.4.0 to 0.17.1. The local attack vector substantially limits opportunistic mass exploitation but does not protect inference servers that expose their batch API to untrusted callers or that load third-party model weights.

Impact

The CVSS 4.0 base score of 8.5 reflects the combination of a local attack vector (AV:L), low complexity (AC:L), no privilege requirement (PR:N), and high impact across confidentiality, integrity, and availability - calibrated downward from theoretical maximum by the required passive user interaction (UI:P). Real-world risk is meaningful but gated by the local attack vector: an attacker must either have local code execution in the same environment or must be able to influence the batch parameters passed to llama_batch_init() through a higher-level application surface (e.g., a malicious model file or crafted API request to an inference server). EPSS data is not available in the provided intelligence; exploitation probability must therefore be inferred from structural signals. The heap corruption primitive producing an RCE-class outcome elevates this above typical integer overflow advisories. No CISA KEV listing and no identified public POC reduce immediate operational urgency, but the broad deployment of llama.cpp across both interactive AI tooling and production inference infrastructure means the blast radius of a working exploit would be substantial. The absence of an explicit released patch version - only a GitHub security patches reference - is a gap that defenders should resolve before assuming a safe upgrade path exists.

Exploit ScenarioDerived

An attacker provides a specially crafted model configuration or batch request to an application using a vulnerable llama.cpp build - for example, submitting a request to a local inference server with n_tokens and n_seq_max values chosen so their product exceeds INT32_MAX. The call to malloc() receives the wrapped (underflowed) size, allocates a small heap buffer, and the subsequent batch write operations overwrite adjacent heap regions, corrupting allocator metadata or function pointers. With a refined heap grooming technique, this corruption can redirect execution to attacker-controlled code within the host process. No public proof-of-concept has been identified at time of analysis, but the overflow is structurally straightforward to reproduce once the triggering parameter values are known.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 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

Integer overflow in llama.cpp's llama_batch_init() function across builds b1283 through b9058 enables heap corruption via unchecked multiplicative arithmetic in malloc() size calculations - when computed allocation sizes wrap past INT32_MAX, the resulting under-sized heap buffer is overwritten by subsequent batch operations, creating a credible path to arbitrary code execution in the context of the host process. The vulnerability affects versions 0.4.0 through 0.17.1 and any application embedding the affected build range of the library. No public exploit code has been identified at time of analysis and the CVE is not listed in the CISA KEV catalog, but the heap corruption primitive paired with the RCE tag warrants expedited patching in production AI inference pipelines.

RemediationAI

Upgrade llama.cpp to a build above b9058 (semantic version above 0.17.1) once a formally released patched version is confirmed - upstream fix commits are referenced at https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches, but a tagged release version has not been independently confirmed from the available data; verify the fix is included in a stable release before deploying. If an immediate upgrade is not feasible, the primary compensating control is to restrict who or what can supply batch parameters to llama_batch_init(): for inference server deployments, enforce authenticated and authorized access to the batch API endpoint and reject untrusted or externally sourced model files, which may carry parameter configurations that trigger the overflow. Sandboxing the inference process (e.g., running llama.cpp inside a container with seccomp/AppArmor profiles) limits the impact of heap corruption to the sandbox rather than the host. Note that sandboxing does not prevent exploitation - it only contains post-exploitation impact. Do not treat the local attack vector as a strong mitigating factor if the deployment exposes an inference API or accepts third-party model inputs.

Affected VersionsENISA

llama.cpp 0.4.0 ≤0.17.1
llama.cpp b1283 ≤b9058

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

llama.cpp (CWE-190: Integer Overflow or Wraparound) is the dominant open-source C/C++ library for quantized large-language-model inference, providing the core inference engine for downstream tools such as Ollama, LM Studio, and numerous embedded AI applications. The vulnerable function llama_batch_init() constructs batch data structures sized by multiplying parameters such as n_tokens and n_seq_max; because these multiplications are performed in 32-bit integer space without bounds checking, sufficiently large attacker-controlled values wrap around INT32_MAX and produce a malloc() size argument far smaller than the data subsequently written into the buffer. CPE-identifiable affected scope is llama.cpp builds b1283 through b9058 (semantic versions 0.4.0 to 0.17.1). The root cause is a classic integer overflow-to-heap-underallocation pattern (CWE-190), where the allocation succeeds but the write primitive derived from the original un-overflowed parameter count then corrupts adjacent heap metadata or data, enabling control-flow hijack.

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 (invoking vulnerable code with attacker-controlled parameters) confirmed; no privileges needed; full heap corruption impacts all three pillars.

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
Red Hat 7.8 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 b1283 through b9058 contain an integer overflow vulnerability in the llama_batch_init() function where unchecked multiplications in malloc() calls can wrap past INT32_MAX when computing allocation sizes. Attackers can pass specially crafted parameters to trigger integer overflow, causing heap corruption and potentially achieving arbitrary code execution through subsequent batch operations that write past allocated buffer boundaries.

Executive ViewAI

Why It Matters

Integer overflow in llama.cpp versions 0.4.0-0.17.1 enables heap corruption leading to arbitrary code execution in production AI inference systems; no public exploit identified at time of analysis. Organizations deploying affected versions risk complete compromise of inference infrastructure and exposure of sensitive model data through malicious batch submissions. Immediate isolation and remediation within 24 hours is critical given the code execution severity.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: implement strict input validation and batch size limits to prevent integer overflow; restrict batch processing to authenticated, trusted sources only; isolate affected services to restricted networks with egress filtering; disable batch processing if operationally feasible; monitor for process crashes, memory corruption indicators, or unauthorized code execution; consider temporary rollback to llama.cpp versions prior to 0.4.0 if compatible with current deployments.

Threat Intelligence Overview

EPSS Score
0.1%
Top 96% exploitable
Prevalence
High
dominant LLM inference library embedded in many AI tools
Data Quality
9 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

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 No
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

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

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-118375 CRITICAL
9.2 Oct 28

Stack-based out-of-bounds write in llama.cpp's ggml-rpc RDMA receive path (builds b8841 through b11865) lets unauthentic

Vendor StatusVendor

SUSE

Severity: Important

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