CVE-2026-27940: ggml-org llama.cpp · Heap-based Buffer Overflow
Affects ggml-org llama.cppSource CVE Database V5
Mentioned vulnerabilities
Not known to be exploited · CVSS 7.8 High : upgrade to b8146 soon.
Data as of 30 Oct 2026, 11:52 UTC
- EPSS
- 0.1% chance of exploitation in 30 days – higher than 8% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in b8146
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 12 Mar 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: evidence found.
Public exploit code: GitHub proofs of concept
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), GitHub proofs of concept, the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.
What to do
Upgrade ggml-org llama.cpp to b8146.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| ggml-orgllama.cpp | Affected
| Fixed in
|
AI-suggested
To mitigate CVE-2026-27940, organizations should immediately update llama.cpp to version b8146 or later, where the vulnerability is fully patched. Users should audit their deployment pipelines to ensure no legacy versions remain in use. Implement strict local access controls to limit who can execute or interact with llama.cpp binaries, reducing the risk of exploitation via user interaction. Employ application whitelisting and endpoint protection to detect anomalous behavior indicative of exploitation attempts. Conduct thorough code reviews and fuzz testing on components handling untrusted input to identify similar integer overflow and buffer overflow issues proactively. Additionally, sandbox llama.cpp execution environments to contain potential compromises and monitor logs for unusual fread() or memory allocation errors. Educate users about the risks of opening untrusted files or inputs that could trigger the vulnerability. Finally, maintain an up-to-date inventory of AI inference tools and their versions to facilitate rapid response to future vulnerabilities.
Description
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.