CVE-2026-33298

llama.cpp has a Heap Buffer Overflow via Integer Overflow in GGUF Tensor Parsing

Published Mar 24, 2026 CVSS 3.1 · 7.8 High EPSS < 1% KEV · Not listed
Description
llama.cpp is an inference of several LLM models in C/C++. Prior to b7824, an integer overflow vulnerability in the `ggml_nbytes` function allows an attacker to bypass memory validation by crafting a GGUF file with specific tensor dimensions. This causes `ggml_nbytes` to return a significantly smaller size than required (e.g., 4MB instead of Exabytes), leading to a heap-based buffer overflow when the application subsequently processes the tensor. This vulnerability allows potential Remote Code Execution (RCE) via memory corruption. b7824 contains a fix.

Analysis

AI-generated

Technical impact

The vulnerability in llama.cpp arises from an integer overflow in the ggml_nbytes function. By crafting a GGUF file with specific tensor dimensions, an attacker can cause the function to return a size that is dramatically smaller than the actual memory required, leading to a heap-based buffer overflow. This chain of events can corrupt the heap, enabling the attacker to execute arbitrary code. The weakness is a classic integer overflow (CWE-190) resulting in memory corruption (CWE-122).

Affected Systems

The affected product is llama.cpp from ggml-org. Versions released before the b7824 commit are vulnerable. The fix is included in release b7824 and later.

Risk and Exploitability

The CVSS score of 7.8 indicates a high severity. The lack of an EPSS score makes it difficult to gauge current exploitation probability, but the absence of a known exploit in the KEV catalog suggests limited active exploitation yet. Exploitation requires an attacker to supply a malicious GGUF file to the application, which may be feasible if the service parses untrusted files or receives files from network or local users. Because the vulnerability leads to a heap buffer overflow, exploitation can result in code execution with the privileges of the running process.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest llama.cpp release (b7824 or later) to incorporate the ggml_nbytes integer overflow patch.
  • If upgrading is not immediately possible, limit the use of GGUF file imports to trusted sources and enforce file validation before processing.
  • Monitor logs for signs of memory corruption or unusual service crashes that could indicate an attempted exploitation.

Generated by OpenCVE AI on March 24, 2026 at 03:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:ggml:llama.cpp:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Ggml
Ggml llama.cpp
Vendors & Products Ggml
Ggml llama.cpp
Type Values Removed Values Added
Description llama.cpp is an inference of several LLM models in C/C++. Prior to b7824, an integer overflow vulnerability in the `ggml_nbytes` function allows an attacker to bypass memory validation by crafting a GGUF file with specific tensor dimensions. This causes `ggml_nbytes` to return a significantly smaller size than required (e.g., 4MB instead of Exabytes), leading to a heap-based buffer overflow when the application subsequently processes the tensor. This vulnerability allows potential Remote Code Execution (RCE) via memory corruption. b7824 contains a fix.
Title llama.cpp has a Heap Buffer Overflow via Integer Overflow in GGUF Tensor Parsing
Weaknesses CWE-122
CWE-190
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'}

Weaknesses
  • CWE-122

    Heap-based Buffer Overflow

  • CWE-190

    Integer Overflow or Wraparound

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 25, 2026, 3:55 AM
Reserved
Mar 18, 2026, 6:55 PM
Status
Analyzed
Published
Mar 24, 2026, 1:17 AM
Modified
Jun 17, 2026, 10:37 AM