CVE-2025-52566: llama.cpp tokenizer signed vs. unsigned heap overflow
Vulnerability summary
CVE-2025-52566 is a high (CVSS 8.8) vulnerability in ggml-org llama.cpp. EPSS estimates a 0.38% chance of exploitation in the next 30 days, higher than 32.7% of scored vulnerabilities. 1 public exploit is recorded.
Public exploit (GitHub, Date unknown)
Source freshness unavailable
How is this decided?Timeline
- 24-06-2025PublishedVulnerability first disclosed.
- 24-06-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
4 scores · 4 sources · 1 version- CVE.orgCNA8.6HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HDiffers
- OSV · UbuntuEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS trend
Probability
0.38%
Chance of exploitation in the next 30 days
Percentile
33%
Versus all other CVEs
30-day change
Increase +0.02 pp
From 0.36% on 21-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundLlama.Cpp
Maturity: poc
Weaknesses
CWE · root cause- CWE-119Improper Restriction of Operations within the Bounds of a Memory BufferThe product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary.
- CWE-195Signed to Unsigned Conversion ErrorThe product uses a signed primitive and performs a cast to an unsigned primitive, which can produce an unexpected value if the value of the signed primitive can not be represented using an unsigned primitive.
Affected systems
Known conditions: local access, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.
Debian1 product
- llama.cpp< 5760+dfsg-1
Ggml1 product
- llama.cpp< b5721
Ggml-org1 product
- llama.cpp< b5721
Ubuntu1 product
- llama.cppAll versions (No fix recorded)
4 vendors · 4 products
References
5 links- github.com/ggml-org/llama.cpp/security/advisories/GHSA-7rxv-5jhh-j6xxX Refsource CONFIRMREPORTExploitVendor Advisory
- github.com/ggml-org/llama.cpp/commit/dd6e6d0b6a4bbe3ebfc931d1eb14db2f2b1d70afX Refsource MISCREPORTPatch