CVE-2026-27940
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.
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
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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
llama.cppDebian:14 |
before 8461+dfsg-1, plus listed versions 5151+dfsg-1~exp25151+dfsg-1~exp35318+dfsg-15318+dfsg-25713+dfsg-1 Show 20 moreShow less5760+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.cppUbuntu: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.cppUbuntu:26.10 |
All versions, plus listed versions 8681+dfsg-19721+dfsg-1ubuntu110438+dfsg-110438+dfsg-1ubuntu1 |
None known |
llama.cppUbuntu: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.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | ngtuonghung/CVE-2026-27940 | 2026-03-29 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE 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
github.com/ggml-org/llama.cpp/security/advisories/GHSA-3p4r-fq3f-q74v
github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27940.json
nvd.nist.gov/vuln/detail/CVE-2026-27940
security-tracker.debian.org/tracker/CVE-2026-27940
ubuntu.com/security/CVE-2026-27940
cve.org/CVERecord?id=CVE-2026-27940