| Component | llama.cpp |
| Severity | high (CVSS 7.8) |
| CVSS vector | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| Published (NVD) | 2026-08-06 |
| Last modified | 2026-09-21 |
| Affected versions | llama.cpp >= b1886, <= b7445 |
| Fixed in | see the vendor advisory |
| Weakness | CWE-122CWE-190 |
| CISA KEV | not listed |
NVD description
llama.cpp builds b1886 through b7445 contain an integer overflow vulnerability in the LLaMA-Android JNI wrapper where the new_1batch() function multiplies sizeof(llama_seq_id) by an attacker-controlled n_seq_max parameter without overflow validation, causing heap buffer allocation to wrap and allocate insufficient memory. Attackers can exploit this by providing a crafted n_seq_max value through a malicious model file or JNI call to trigger heap corruption and achieve denial of service or arbitrary code execution on Android applications using the LLaMA-Android binding.
What to do
- NVD lists no fixed version yet: follow the vendor advisory below and keep llama.cpp off the public internet until a fix ships.
- Do not expose the component's API or UI to the internet without authentication in front of it.
Sources
- NVD: CVE-2026-70638
- https://github.com/ggml-org/llama.cpp/releases/tag/b7446
- https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches
- https://github.com/ggml-org/llama.cpp/commit/5c0d18881e0e9794c96b2602736b758bac9d9388
- https://www.vulncheck.com/advisories/llama-cpp-b1886-b7445-integer-overflow-via-new-1batch-in-llama-android-cpp
Other llama.cpp CVEs
llama.cpp before b11393 contains a use-after-free and double free vulnerability in common_chat_peg_mapper::map that allows unauthenticated r...
A vulnerability was detected in ggml-org llama.cpp up to 0.4.0. This impacts the function rpc_server::deserialize_tensor of the file ggml/sr...
llama.cpp through commit 97f06e9, when started with the --reranking flag, allows remote attackers to cause a denial of service (std::bad_all...
llama.cpp b5693 and before has a Reachable Assertion via the gguf_reader::read function.
llama.cpp b5693 and before is vulnerable to Uncontrolled Recursion in common/json-schema-to-grammar.cpp, resulting in a denial of service.
A vulnerability was determined in ggml-org llama.cpp bec4772f6. This affects the function rpc_server::graph_compute of the file ggml/src/ggm...