CVE-2026-27940 llama.cpp has a Heap Buffer Overflow via Integer Overflow in `mem_size` Calculation — Bypass of CVE-2025-53630 Fix
HighCVSS 7.8
EPSS 0.21%
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: no · technical impact: total
- Technology
- UbuntuDebian
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.
Upgrade path
5 packages: 2 fixed, 2 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| ubuntu/llama.cpp(Ubuntu 26.04) | All versions | No fix listed | No fix yet |
| ubuntu/llama.cpp(Ubuntu 26.10) | All versions | No fix listed | No fix yet |
| debian/llama.cpp(Debian 14) | < 8461+dfsg-1; = 5151+dfsg-1~exp2; = 5151+dfsg-1~exp3; = 5318+dfsg-1 +22 more | 8461+dfsg-1 | Fixed |
| ggml llama.cpp | < b8146 | b8146 | Fixed |
| ggml-org llama.cpp | = < b8146 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| ggml-org llama.cpp | = < b8146 | No fix listed |
| debian/llama.cpp(Debian:14) | < 8461+dfsg-1 | 8461+dfsg-1 |
| debian/llama.cpp(Debian:14) | = 5151+dfsg-1~exp2 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5151+dfsg-1~exp3 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5318+dfsg-1 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5318+dfsg-2 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5713+dfsg-1 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5760+dfsg-1 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5760+dfsg-2 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5760+dfsg-3 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5760+dfsg-4 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5882+dfsg-1 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5882+dfsg-2 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5882+dfsg-3 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5882+dfsg-3~exp1 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5882+dfsg-3~exp2 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5882+dfsg-3~exp3 | No fix listed |
| debian/llama.cpp(Debian:14) | = 5882+dfsg-4 | No fix listed |
| debian/llama.cpp(Debian:14) | = 6641+dfsg-1 | No fix listed |
| debian/llama.cpp(Debian:14) | = 6641+dfsg-2 | No fix listed |
| debian/llama.cpp(Debian:14) | = 6641+dfsg-3 | No fix listed |
| debian/llama.cpp(Debian:14) | = 7593+dfsg-1 | No fix listed |
| debian/llama.cpp(Debian:14) | = 7593+dfsg-2 | No fix listed |
| debian/llama.cpp(Debian:14) | = 7593+dfsg-3 | No fix listed |
| debian/llama.cpp(Debian:14) | = 7965+dfsg-1 | No fix listed |
Show 5 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/llama.cpp(Debian:14) | = 8064+dfsg-1 | No fix listed |
| debian/llama.cpp(Debian:14) | = 8064+dfsg-2 | No fix listed |
| ubuntu/llama.cpp(Ubuntu:26.04) | All versions | No fix listed |
| ubuntu/llama.cpp(Ubuntu:26.10) | All versions | No fix listed |
| ggml llama.cpp | < b8146 | b8146 |
References
- https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-3p4r-fq3f-q74v exploit vendor-advisory
- Debian Security Tracker CVE-2026-27940 vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- www.cve.org