CVE-2026-33298 llama.cpp has a Heap Buffer Overflow via Integer Overflow in GGUF Tensor Parsing
An integer overflow in llama.cpp allows attackers to trigger a heap buffer overflow via crafted GGUF files, potentially leading to remote code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-33298?
CVE-2026-33298 is a high-severity vulnerability in ggml-org llama.cpp, published on 24 Mar 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official 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.
Which versions are affected by CVE-2026-33298?
It affects 1 product.
Products include Ggml Llama.cpp.
How do I fix CVE-2026-33298?
Upgrade to a fixed version.
Is CVE-2026-33298 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-33298 exists.
Other vulnerabilities in ggml-org llama.cpp
- CVE-2024-42479 llama.cpp allows write-what-where in rpc_server::set_tensor
- CVE-2026-34159 llama.cpp: Unauthenticated RCE via GRAPH_COMPUTE buffer=0 bypass in llama.cpp RPC backend
- CVE-2026-43629 llama.cpp b4882–b9058 Buffer Overflow in KV Cache State Restore
- CVE-2026-43631 llama.cpp b7492–b9060 Use-After-Free RCE via llama-server
- CVE-2026-43632 llama.cpp b7492–b9060 Use-After-Free in Tokenization Endpoints
Sources
Also known as DEBIAN-CVE-2026-33298, GHSA-96jg-mvhq-q7q7, UBUNTU-CVE-2026-33298.