Every CVE Search/ Get API key

CVE-2026-27940

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

7.8 HighPublic exploitFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

0.21%Up 0.2 points since Mar 13, 2026
90%50%10%1%

What each source reports

CVE List Score used 7.8

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

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.

Record
CVE-2026-27940
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-122, CWE-190
Updated
2026-11-02
EUVDEUVD-2026-11605 7.8

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.

Record
EUVD-2026-11605
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
NVD 7.8

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.

Record
CVE-2026-27940
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-122, CWE-190
Updated
2026-11-02
OSV 7.8

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

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.

Record
CVE-2026-27940
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-122, CWE-190
Updated
2026-11-02
OSVDEBIAN-CVE-2026-27940 7.8

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.

Record
DEBIAN-CVE-2026-27940
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2026-27940 7.8

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.

Record
UBUNTU-CVE-2026-27940
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
llama.cpp
Debian:14
before 8461+dfsg-1, plus listed versions
5151+dfsg-1~exp25151+dfsg-1~exp35318+dfsg-15318+dfsg-25713+dfsg-1
Show 20 moreShow less
5760+dfsg-15760+dfsg-25760+dfsg-35760+dfsg-45882+dfsg-15882+dfsg-25882+dfsg-35882+dfsg-3~exp15882+dfsg-3~exp25882+dfsg-3~exp35882+dfsg-46641+dfsg-16641+dfsg-26641+dfsg-37593+dfsg-17593+dfsg-27593+dfsg-37965+dfsg-18064+dfsg-18064+dfsg-2
8461+dfsg-1
llama.cpp
Ubuntu:25.10
All versions, plus listed versions
5318+dfsg-15318+dfsg-25713+dfsg-15760+dfsg-15760+dfsg-35760+dfsg-45882+dfsg-2
None known
llama.cpp
Ubuntu:26.10
All versions, plus listed versions
8681+dfsg-19721+dfsg-1ubuntu110438+dfsg-110438+dfsg-1ubuntu1
None known
llama.cpp
Ubuntu:26.04:LTS
All versions, plus listed versions
5882+dfsg-28064+dfsg-1ubuntu18681+dfsg-1
None known

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
PoC in GitHubngtuonghung/CVE-2026-279402026-03-29

History

History
RecordedChangedSources
first indexedCVE List, EUVD, NVD, OSV, PoC in GitHub

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-27940 is a high vulnerability (CVSS 7.8) in Ggml Llama.cpp, published March 12, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.21%, the 11th percentile. Fixed in llama.cpp 8461+dfsg-1.

References

MoveEnter Open