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.

Severity (CVSS 3.1)8.6High
Exploit odds (30 days)0.4%top 69.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:14llama.cpp5760+dfsg-1DEBIAN-CVE-2025-52566
Ubuntu:25.10llama.cppno fix listedUBUNTU-CVE-2025-52566
Ubuntu:26.04:LTSllama.cppno fix listedUBUNTU-CVE-2025-52566
Ubuntu:26.10llama.cppno fix listedUBUNTU-CVE-2025-52566

Affected products (as reported)

VendorProductVersions
ggml-org llama.cpp < b5721

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

References