CVE-2025-52566

llama.cpp tokenizer signed vs. unsigned heap overflow

State
Published
Severity
8.6 High
Published
Jun 24, 2025
Updated
Jun 24, 2025
Reserved
Jun 18, 2025

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.18.6 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HGitHub_M

Weaknesses

  • CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer
  • CWE-195 Signed to Unsigned Conversion Error

Affected Products

ProductVersions
llama.cppggml-org
  • < b5721Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.