Vulnerability · Published Jun 24, 2025 · Assigned by GitHub_M
CVE-2025-52566llama.cpp tokenizer signed vs. unsigned heap overflow
High 8.6
In plain English
A high-severity memory corruption in llama.cpp from ggml-org. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 30% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
llama.cpp is an inference of several LLM models in C/C++. Prior to version b5721, there is a signed vs. unsigned integer overflow in llama.cpp's tokenizer implementation (llama_vocab::tokenize) (src/llama-vocab.cpp:3036) resulting in unintended behavior in tokens copying size comparison. Allowing heap-overflowing llama.cpp inferencing engine with carefully manipulated text input during tokenization process. This issue has been patched in version b5721.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:14 | llama.cpp | 5760+dfsg-1 | DEBIAN-CVE-2025-52566 |
| Ubuntu:25.10 | llama.cpp | no fix listed | UBUNTU-CVE-2025-52566 |
| Ubuntu:26.04:LTS | llama.cpp | no fix listed | UBUNTU-CVE-2025-52566 |
| Ubuntu:26.10 | llama.cpp | no fix listed | UBUNTU-CVE-2025-52566 |
Affected products (as reported)
Weakness: CWE-119, CWE-195 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H