We use these services and cookies to improve your user experience. You may opt out if you wish, however, this may limit some features on this site.

Please see our statement on Data Privacy.

Crisp.chat (Helpdesk and Chat)

Ok

THREATINT
PUBLISHED

CVE-2025-49847

llama.cpp Vulnerable to Buffer Overflow via Malicious GGUF Model



Description

llama.cpp is an inference of several LLM models in C/C++. Prior to version b5662, an attacker‐supplied GGUF model vocabulary can trigger a buffer overflow in llama.cpp’s vocabulary‐loading code. Specifically, the helper _try_copy in llama.cpp/src/vocab.cpp: llama_vocab::impl::token_to_piece() casts a very large size_t token length into an int32_t, causing the length check (if (length < (int32_t)size)) to be bypassed. As a result, memcpy is still called with that oversized size, letting a malicious model overwrite memory beyond the intended buffer. This can lead to arbitrary memory corruption and potential code execution. This issue has been patched in version b5662.

Reserved 2025-06-11 | Published 2025-06-17 | Updated 2025-06-17 | Assigner GitHub_M


HIGH: 8.8CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Problem types

CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer

CWE-195: Signed to Unsigned Conversion Error

Product status

< b5662
affected

References

github.com/...ma.cpp/security/advisories/GHSA-8wwf-w4qm-gpqr

github.com/...ommit/3cfbbdb44e08fd19429fed6cc85b982a91f0efd5

cve.org (CVE-2025-49847)

nvd.nist.gov (CVE-2025-49847)

Download JSON

Share this page
https://cve.threatint.eu/CVE/CVE-2025-49847

Support options

Helpdesk Chat, Email, Knowledgebase