Skip to main content
CVE-2025-52566VulnerabilityPublished

CVE-2025-52566: ggml-org llama.cpp · Memory Buffer Overflow

Affects ggml-org llama.cppSource CVE Database V5

0

Not known to be exploited · CVSS 8.6 High : upgrade to b5721 soon.

Data as of 26 Oct 2026, 06:26 UTC

CVSS 3.1 base score
8.6High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.3% chance of exploitation in 30 days – higher than 29% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in b5721
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 24 Jun 2025

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.

What to do

Upgrade ggml-org/llama.cpp to b5721.

Affected software

ProductAffectedFixed in
GitHubggml-org/llama.cpppkg:github/ggml-org/llama.cppOther threatsAffected
  • <b5721
Fixed in
  • b5721

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

1. Immediate upgrade to llama.cpp version b5721 or later where the vulnerability is patched. 2. Implement strict input validation and sanitization on all text inputs fed into the tokenizer to reduce the risk of maliciously crafted inputs triggering the overflow. 3. Employ runtime memory protection mechanisms such as AddressSanitizer during development and testing to detect similar memory issues early. 4. Restrict access to systems running llama.cpp inference engines to trusted users only and monitor for unusual user activity that could indicate exploitation attempts. 5. Use containerization or sandboxing to isolate the llama.cpp process, limiting the impact of potential exploitation on the host system. 6. Regularly audit and update all AI-related dependencies and libraries to ensure vulnerabilities are promptly addressed. 7. Incorporate anomaly detection on AI service outputs and system behavior to detect signs of compromise or instability caused by exploitation attempts. 8. Educate developers and operators about secure coding practices related to memory management in C/C++ to prevent similar vulnerabilities in custom extensions or integrations.

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.

References

Community reviews

Loading reviews…