CVE-2026-43627

llama.cpp b1283–b9058 Integer Overflow in llama_batch_init() Function

Published Aug 6, 2026 CVSS 4.0 · 8.5 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability is an unchecked integer multiplication in the llama_batch_init() function of ggml‑org llama.cpp (versions b1283 through b9058). During allocation size calculations, the product can overflow INT32_MAX, causing heap corruption. An attacker who can supply crafted batch parameters may trigger the overflow and subsequently write beyond the allocated buffer, potentially achieving arbitrary code execution. This flaw is identified as CWE‑190 (Integer Overflow or Wraparound), CWE‑680 (Integer Overflow to Buffer Overflow), and CWE‑805.

Affected Systems

Affected systems are ggml‑org llama.cpp versions b1283 to b9058. The patched source code is available at https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches. Users running any of these builds should upgrade immediately.

Risk and Exploitability

The CVSS base score is 8.5, indicating high severity. The EPSS score of < 1% indicates a very low yet non‑zero likelihood of exploitation, and the vulnerability is not listed in CISA KEV. Attackers can trigger the overflow by submitting specially crafted batch parameters, suggesting the attack vector depends on whether batch operations are exposed over the network or to local users. If batch processing is exposed, the flaw could be exploited remotely. If only local, the risk remains significant. This flaw is identified as CWE‑190 (Integer Overflow or Wraparound), CWE‑680 (Integer Overflow to Buffer Overflow), and CWE‑805.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the security patch from the referenced GitHub repository before rebuilding and deploying the llama.cpp binary.
  • Rebuild and deploy the updated llama.cpp executable.
  • If the patch cannot be applied immediately, constrain batch parameters to values that cannot trigger the overflow and add runtime input validation to ensure allocation sizes remain within safe bounds.

Generated by OpenCVE AI on August 13, 2026 at 10:42 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Ggml
Ggml llama.cpp
CPEs cpe:2.3:a:ggml:llama.cpp:*:*:*:*:*:*:*:*
Vendors & Products Ggml
Ggml llama.cpp
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Ggml-org
Ggml-org llama.cpp
Vendors & Products Ggml-org
Ggml-org llama.cpp
Type Values Removed Values Added
Description 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.
Title llama.cpp b1283–b9058 Integer Overflow in llama_batch_init() Function
Weaknesses CWE-190
CWE-680
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.5, 'vector': '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'}

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

  • CWE-680

    Integer Overflow to Buffer Overflow

  • CWE-805

    Buffer Access with Incorrect Length Value

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 29, 2026, 9:15 PM
Reserved
May 1, 2026, 6:22 PM
Status
Analyzed
Published
Aug 6, 2026, 10:17 PM
Modified
Oct 29, 2026, 9:17 PM
Severity
Important
Public date
Aug 6, 2026, 3:40 PM