Integer overflow in llama.cpp GGUF loader allows out-of-bounds memory access

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-116829?

CVE-2026-116829 is a vulnerability classified as Integer Overflow or Wraparound, affecting llama.cpp (affected versions: b10398 – < b11301 and 0.1.0 – < 0.6.0). This vulnerability is rated Medium, with a CVSS score of 6.9. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

llama.cpp b10398 before b11301 contains an integer overflow vulnerability in gguf_init_from_reader that allows attackers to bypass tensor element-count validation by supplying shapes whose product wraps to zero. Attackers can craft GGUF files with enormous tensor extents that overflow ggml_nbytes() and strides, causing out-of-bounds memory access when buffers are sized from wrapped byte counts.

Affected products and scope

The vulnerability affects llama.cpp builds in a specific range between two release identifiers. Builds before the fix and builds at the fix are the boundary. Semver-tagged releases in an earlier range are also affected. Builds at or after the fixed release are not affected. The affected code path is the GGUF model file loading subsystem.

Technical details

The vulnerability is in gguf_init_from_reader, the function that parses GGUF model files and sets up tensor metadata. When a GGUF file declares tensor shapes, the code computes the total element count by multiplying the shape dimensions. If the attacker chooses dimensions whose product overflows the integer type and wraps to zero, the element-count validation is bypassed. Downstream, ggml_nbytes() computes the byte size of a tensor from its element count and element size; with the overflowed or wrapped values, it returns a byte count far smaller than the actual tensor requires. The allocator then sizes a buffer to that wrapped value, and subsequent writes that use the original (large) tensor dimensions write past the end of the allocated buffer, producing an out-of-bounds access.

Exploitability

The attack vector is local. The attacker must deliver a crafted GGUF file to the target and the target must open or load it. No authentication is required beyond the ability to place a file where the application will read it. User interaction is required (passive, in the sense that the user does not need to take a deliberate action beyond triggering the load). A public proof-of-concept exists, but there is no confirmed in-the-wild exploitation.

Technical impact

An attacker who successfully triggers this vulnerability can read or write memory outside the intended buffer. The realistic outcomes are process crash (denial of service), limited disclosure of adjacent memory contents, or controlled memory corruption that could in principle be shaped into code execution, though no public exploit demonstrating code execution is reported. Confidentiality and integrity impact are assessed as low; availability impact is high.

Business impact

Any organisation that accepts GGUF model files from untrusted sources, or that runs llama.cpp in a service where users can upload or reference model files, is exposed. The primary risk is denial of service: a crafted file can crash the process. Because the attack requires local file delivery and user interaction, it is less suitable for large-scale remote attacks, but it is relevant for applications that ingest model files from external pipelines, model registries, or user uploads. A crash in an inference service means lost requests and potential cascading failures if the service is not designed to recover from unhandled exceptions.

Remediation

Update to the patched release. The fix is available in a subsequent build; apply it as soon as practicable. Until the update is applied, treat untrusted GGUF files as hostile input: do not load model files from unverified sources, and run inference services with minimal privileges and resource limits so that a crash does not compromise the host.

Detection

Look for process crashes or segfaults in llama.cpp inference services, particularly if they follow the loading of a model file. Check whether your deployment accepts model files from external sources (user uploads, model registries, CI/CD pipelines). If it does, review recent model file additions for anomalies: unusually large declared tensor dimensions, or files whose stated tensor sizes do not match their actual file size. Monitor for repeated crash loops in inference workers that may indicate a targeted or automated attempt.

Sources (11)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.