CVE-2025-49847: llama.cpp Vulnerable to Buffer Overflow via Malicious GGUF Model
Vulnerability summary
CVE-2025-49847 is a high (CVSS 8.8) vulnerability in ggml-org llama.cpp. EPSS estimates a 0.55% chance of exploitation in the next 30 days, higher than 47% of scored vulnerabilities.
Not severe (CVSS 8.8, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 17-06-2025PublishedVulnerability first disclosed.
- 18-06-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
4 scores · 4 sources · 1 version- OSV · UbuntuEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- NVDNIST8.8HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS trend
Probability
0.55%
Chance of exploitation in the next 30 days
Percentile
47%
Versus all other CVEs
30-day change
Increase +0.04 pp
From 0.52% on 21-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-119Improper Restriction of Operations within the Bounds of a Memory BufferThe product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary.
- CWE-195Signed to Unsigned Conversion ErrorThe product uses a signed primitive and performs a cast to an unsigned primitive, which can produce an unexpected value if the value of the signed primitive can not be represented using an unsigned primitive.
Affected systems
Known conditions: network-reachable, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.
Debian1 product
- llama.cpp< 5713+dfsg-1
Ggml1 product
- llama.cpp< b5662
Ggml-org1 product
- llama.cpp< b5662
Opensuse1 product
- llamacpp&distro=openSUSE Tumbleweed< 5699-1.1
Ubuntu1 product
- llama.cppAll versions (No fix recorded)
5 vendors · 5 products
References
6 links- github.com/ggml-org/llama.cpp/security/advisories/GHSA-8wwf-w4qm-gpqrX Refsource CONFIRMREPORTMitigationVendor Advisory
- github.com/ggml-org/llama.cpp/commit/3cfbbdb44e08fd19429fed6cc85b982a91f0efd5X Refsource MISCREPORTPatch