Skip to main content
← All vulnerabilities
CVE-2026-27940

llama.cpp has a Heap Buffer Overflow via Integer Overflow in `mem_size` Calculation — Bypass of CVE-2025-53630 Fix

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in b8146
1 proof of concept on GitHub
  • Exploitation: poc
  • Automatable: no
  • Technical impact: total

Summary

llama.cpp is an inference of several LLM models in C/C++. Prior to b8146, the gguf_init_from_file_impl() in gguf.cpp is vulnerable to an Integer overflow, leading to an undersized heap allocation. Using the subsequent fread() writes 528+ bytes of attacker-controlled data past the buffer boundary. This is a bypass of a similar bug in the same file - CVE-2025-53630, but the fix overlooked some areas. This vulnerability is fixed in b8146.

Timeline

  1. CISA SSVC assessment

    Exploitation: poc · Automatable: no · Technical impact: total

  2. CVE published
  3. Record last updated

Affected versions

  • ggml-org llama.cpp

    fixed in b8146

References 2

GitHub · ggml-org/llama.cpp

GitHub · ngtuonghung/CVE-2026-27940