# CVE-2026-116840: llama.cpp integer overflow in gguf_init_from_reader

Source: https://junglewise.ai/threats/cve-2026-116840-llama-cpp-b5854-before-b11275-contains-an-integer-overflow  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-27. Updated: 2026-10-27  
License: CC BY 4.0 with a link back

CVE-2026-116840 · Severity: medium · CVSS 6.1 · Published 2026-10-27

llama.cpp is a machine learning inference library that loads AI models from GGUF files. An integer overflow vulnerability allows attackers to supply a maliciously crafted GGUF file that bypasses size validation checks, causing the library to read from undersized data regions and potentially exposing sensitive data or causing crashes.

Technologies: [GGML Llama.Cpp](https://junglewise.ai/threats/technologies/llama-cpp). Vendors: [GGML](https://junglewise.ai/threats/vendors/ggml).

## Quick answers

**Is CVE-2026-116840 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-116840 being exploited in the wild.

**How severe is CVE-2026-116840?** Medium severity, with a CVSS score of 6.1, published 27 October 2026.

**Which products and versions are affected?** GGML Llama.Cpp b5854 before b11275.

**Is there a fix for CVE-2026-116840?** Yes: fixed in b11275 and later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-116840 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-116840?** Check whether you run GGML Llama.Cpp at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in b11275 and later

## Technical details

An integer overflow in gguf_init_from_reader occurs when tensor sizes near SIZE_MAX are padded to a multiple of the alignment requirement, causing the result to wrap to zero and bypass the CVE-2025-53630 size check. An attacker can craft a GGUF file with a tensor of size (SIZE_MAX - 15) that pads to zero, resulting in an undersized data blob that causes out-of-bounds reads when the model is loaded.

## Affected products

- GGML llama.cpp b5854 before b11275

## Timeline

- 2026-10-27: disclosed
- other: Prior CVE-2025-53630 addressed related size overflow checks

## References

- [https://github.com/ggml-org/llama.cpp/blob/v0.5.0/ggml/src/gguf.cpp](https://github.com/ggml-org/llama.cpp/blob/v0.5.0/ggml/src/gguf.cpp)
- [https://github.com/ggml-org/llama.cpp/commit/a6ea155d3d38b3f6f43d0c0dc29c2d592413ef44](https://github.com/ggml-org/llama.cpp/commit/a6ea155d3d38b3f6f43d0c0dc29c2d592413ef44)

## Related threats

- [llama.cpp denial of service via negative top_n in reranking API](https://junglewise.ai/threats/cve-2026-52132-llama-cpp-denial-of-service-via-negative-top-n-in-reranking-api)
- [llama.cpp uncontrolled recursion denial of service in json-schema-to-grammar](https://junglewise.ai/threats/cve-2026-52131-llama-cpp-uncontrolled-recursion-denial-of-service-in-json-schema)
- [llama.cpp uncontrolled recursion in JSON schema converter](https://junglewise.ai/threats/cve-2026-52130-llama-cpp-uncontrolled-recursion-in-json-schema-converter)
- [llama.cpp builds b1886 through b7445 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI…](https://junglewise.ai/threats/cve-2026-70640-llama-cpp-builds-b1886-through-b7445-contain-a-race-condition-use)
- [llama.cpp builds b1886 through b7445 contain a null pointer dereference vulnerability in the LLaMA-Android JNI wrapper…](https://junglewise.ai/threats/cve-2026-70639-llama-cpp-builds-b1886-through-b7445-contain-a-null-pointer)
