# CVE-2025-52566: llama.cpp tokenizer signed vs. unsigned heap overflow

- Severity: High 8.6 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.38%, higher than 33% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-06-24T03:21:19.009Z
- Modified: 2026-06-17T09:36:41.500Z
- Weaknesses: CWE-119, CWE-195
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- ggml-org llama.cpp: < b5721
- ggml llama.cpp: before b5721

## Every score

- GitHub_M: CVSS:3.1 8.6 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-7rxv-5jhh-j6xx> (exploit, vendor-advisory)
- <https://github.com/ggml-org/llama.cpp/commit/dd6e6d0b6a4bbe3ebfc931d1eb14db2f2b1d70af> (patch)

## Sources

- CVE List: [CVE-2025-52566](https://www.cve.org/CVERecord?id=CVE-2025-52566), CVE Terms of Use, modified 2025-06-24
- NVD: [CVE-2025-52566](https://nvd.nist.gov/vuln/detail/CVE-2025-52566), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-52566 · Whole record: https://cve.day/CVE-2025-52566.json · Rebuilt by cve.day 2026-11-25T22:58:59.554Z
