CVE-2025-52566 Details
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.
A signed to unsigned integer overflow vulnerability has been identified in the tokenizer implementation of llama.cpp, prior to version b5721. This vulnerability occurs in the function llama_vocab::tokenize, located in src/llama-vocab.cpp, and it arises from an improper size comparison during the token copying process. The flaw allows for a heap overflow in the llama.cpp inferencing engine by carefully manipulating text input during the tokenization process. Although this vulnerability could potentially be exploited with human-generated messages or prompts, it is considered less dangerous due to existing safeguards in the message handling process. However, these safeguards can be bypassed by exploiting the latest jinja template support, leading to a more significant risk.
Users should update to version b5721 or later, where this vulnerability has been patched.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jun 24, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-7rxv-5jhh-j6xx | CISA-ADP | ExploitVendor Advisory |
| https://github.com/ggml-org/llama.cpp/commit/dd6e6d0b6a4bbe3ebfc931d1eb14db2f2b1d70af | [email protected] | Patch |
| https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-7rxv-5jhh-j6xx | [email protected] | ExploitVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-119 | Improper Restriction of Operations within the Bounds of a Memory Buffer | [email protected] |
| CWE-195 | Signed to Unsigned Conversion Error | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| ggml llama.cpp | < b5721 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Aug 27, 2025 | Initial Analysis | [email protected] |
| Jun 24, 2025 | CVE Modified | CISA-ADP |
| Jun 24, 2025 | New CVE Received | [email protected] |