{"id":"CVE-2025-49847","aliases":["DEBIAN-CVE-2025-49847","EUVD-2025-18632","GHSA-8wwf-w4qm-gpqr","UBUNTU-CVE-2025-49847","openSUSE-SU-2025:15245-1"],"status":"published","title":"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 \u003c (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.","severity":{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00515,"percentile":0.44196,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-119","CWE-195"],"published":"2025-06-17T20:04:40Z","modified":"2026-10-28T11:02:00Z","fixes":[{"ecosystem":"Debian:14","package":"llama.cpp","fixed_in":["5713+dfsg-1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"llamacpp","fixed_in":["5699-1.1"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Debian:14","package":"llama.cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5713+dfsg-1"}]}],"versions":["5151+dfsg-1~exp2","5151+dfsg-1~exp3","5318+dfsg-1","5318+dfsg-2"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"llama.cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["5318+dfsg-1","5318+dfsg-2","5713+dfsg-1","5760+dfsg-1","5760+dfsg-3","5760+dfsg-4","5882+dfsg-2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"llama.cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8681+dfsg-1","9721+dfsg-1ubuntu1","10438+dfsg-1","10438+dfsg-1ubuntu1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"llama.cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["5882+dfsg-2","8064+dfsg-1ubuntu1","8681+dfsg-1"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"llamacpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5699-1.1"}]}]}],"products":[{"vendor":"ggml","product":"llama.cpp"},{"vendor":"ggml-org","product":"llama.cpp"}],"references":[{"url":"https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-8wwf-w4qm-gpqr","tags":["x_refsource_CONFIRM","Mitigation","Vendor Advisory","advisory","report"]},{"url":"https://github.com/ggml-org/llama.cpp/commit/3cfbbdb44e08fd19429fed6cc85b982a91f0efd5","tags":["x_refsource_MISC","Patch","fix","report"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/49xxx/CVE-2025-49847.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-49847","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2025-49847","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2025-49847","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-49847","tags":["report"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2025-49847","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2025-49847","title":"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 \u003c (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.","status":"published","published":"2025-06-17T20:04:40.893Z","modified":"2025-06-18T13:41:11.407Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-119","CWE-195"],"updated_at":"2026-11-02T14:32:24.825718Z"}],"euvd":[{"id":"EUVD-2025-18632","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 \u003c (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.","status":"published","published":"2025-06-17T20:04:40Z","modified":"2025-06-18T13:41:11Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T20:32:20.512078Z"}],"nvd":[{"id":"CVE-2025-49847","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 \u003c (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.","status":"published","published":"2025-06-17T20:15:32.437Z","modified":"2026-06-17T09:32:00.73Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"}],"cwes":["CWE-119","CWE-195"],"updated_at":"2026-11-02T14:11:13.247441Z"}],"osv":[{"id":"CVE-2025-49847","title":"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 \u003c (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.","status":"published","published":"2025-06-17T20:04:40.893Z","modified":"2026-10-28T11:02:00.530754459Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-119","CWE-195"],"updated_at":"2026-11-02T15:44:50.037003Z"},{"id":"DEBIAN-CVE-2025-49847","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 \u003c (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.","status":"published","published":"2025-06-17T20:15:32.437Z","modified":"2026-09-01T20:05:53.376526068Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:45:47.378563Z"},{"id":"UBUNTU-CVE-2025-49847","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 \u003c (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.","status":"published","published":"2025-06-17T20:15:00Z","modified":"2026-10-17T12:58:36.440465437Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T16:55:50.31802Z"},{"id":"openSUSE-SU-2025:15245-1","title":"ggml-devel-5699-1.1 on GA media","description":"These are all security issues fixed in the ggml-devel-5699-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2025-07-03T00:00:00Z","modified":"2026-03-23T04:53:32.605979Z","updated_at":"2026-11-02T16:58:37.399567Z"}]}}
