llama.cpp vulnerabilities
16 known CVE vulnerabilities in llama.cpp, translated and rated.
- CVE-2026-78148Medium
A vulnerability was determined in ggml-org llama.cpp bec4772f6 in the rpc_server::graph_compute function of ggml/src/ggml-rpc/ggml-rpc.cpp of the ggml-RPC Server component. Executing a manipulation can lead to null pointer dereference. The attack may be launched remotely. The pull request to fix this issue awaits acceptance.
- CVE-2026-78147High
A vulnerability in llama.cpp in the deserialize_tensor function of ggml/src/ggml-rpc/ggml-rpc.cpp of the ggml-RPC Server component. Manipulation of the op/op_params arguments leads to deserialization. The attack can be initiated remotely. This vulnerability is distinct from CVE-2026-34159, which only added a buffer==nullptr rejection in create_node() and does not validate op or op_params. The reported GitHub issue was closed automatically due to inactivity.
- CVE-2026-39909High
llama.cpp before b8585 contains a use-after-free vulnerability in the RPC server's GRAPH_RECOMPUTE handler that allows unauthenticated remote attackers to achieve arbitrary read and write access and full remote code execution.
- CVE-2026-70640High
llama.cpp builds b1886 through b7445 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI wrapper where bench_1model() and free_1context() lack synchronization, allowing Thread A to operate on freed memory while Thread B concurrently frees the llama_context. Attackers can exploit this by performing heap spray with attacker-controlled data containing a fake vtable to hijack the vtable pointer and achieve remote code execution.
- CVE-2026-70639Medium
In llama.cpp builds b1886 through b7445, there is a null pointer dereference vulnerability in the LLaMA-Android JNI wrapper where the bench_1model() function fails to validate the model context pointer before dereferencing it. Attackers can supply a malicious, corrupt, or truncated model file to trigger a null context condition, causing a SIGSEGV crash that terminates the Android application process.
- CVE-2026-70638High
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.
- CVE-2026-43632High
llama.cpp builds b7492 through the latest b9060 contains a use-after-free vulnerability in llama-server affecting six tokenization endpoints (/tokenize, /detokenize, /infill, /apply-template, /rerank, and /anthropic/count_tokens) that bypass the task queue and access ctx_server.vocab directly on HTTP worker threads. Attackers can exploit a time-of-check-time-of-use race condition where the main thread destroys and frees vocab after the synchronization lock is released but before the handler finishes using it, causing a crash or potential code execution when --sleep-idle-seconds is configured.
- CVE-2026-43631High
llama.cpp builds b7492 through the latest b9060 contains a use-after-free vulnerability in the vocab pointer of llama-server when the --sleep-idle-seconds feature is enabled, allowing unauthenticated remote attackers to execute arbitrary code. Attackers can trigger the vulnerability by sending requests to affected endpoints while the server transitions to sleep mode, causing concurrent worker threads to dereference a freed vocab pointer that can be reclaimed with attacker-controlled data to achieve remote code execution.
- CVE-2026-43630Medium
llama.cpp builds b5702 through b7653 contain an out-of-bounds read vulnerability in the recurrent memory state restore path that allows attackers with write access to the slot save directory to read memory past the end of the allocated cells array. Attackers can craft a malicious slot file with an oversized seq_id value to trigger an out-of-bounds read that leaks heap data including pointer values into server logs, defeating ASLR protections and facilitating further exploitation.
- CVE-2026-43629High
Heap buffer overflow vulnerability in llama.cpp (builds b4882 through b9058) in the KV cache state restore path. The state_read_data() function computes write size without overflow checking, allowing attackers with write access to the slot_save_path directory to corrupt heap memory.
- CVE-2026-43628High
Integer underflow and out-of-bounds read vulnerability in the DRY sampler in llama.cpp (builds b3978 through b9058). Unauthenticated attackers can trigger a heap buffer underflow by sending a crafted HTTP request with dry_allowed_length set to INT32_MIN to the /v1/completions or /v1/chat/completions endpoints.
- CVE-2026-43627High
Integer overflow vulnerability in the llama_batch_init() function in llama.cpp (builds b1283 through b9058). Unchecked multiplications in malloc() calls can wrap past INT32_MAX when computing allocation sizes.
- CVE-2026-43622High
llama.cpp builds b1886 through b7445 contain a double free vulnerability in the LLaMA-Android JNI wrapper where new_1batch() allocates memory using malloc() while free_1batch() deallocates it using the C++ delete operator, causing heap metadata corruption. Attackers can trigger this memory management mismatch to cause denial of service through process crashes or potentially achieve arbitrary code execution depending on allocator state.
- CVE-2026-18581Low
In ggml-org llama.cpp (commit e15efe0), a vulnerability in the Jinja Minja Template Parser (parser.cpp) allows a reachable assertion via input {{9|9|{. Local access is required.
- CVE-2026-17501Medium
A flaw was found in ggml-org llama.cpp (commit e15efe0) in the transform function of common/json-schema-to-grammar.cpp, causing uncontrolled recursion during JSON-Schema-to-GBNF conversion. The attack can be initiated remotely.
- CVE-2026-17500Medium
A vulnerability was detected in ggml-org llama.cpp d006858/e15efe0. This affects the function _visit_pattern of the file common/json-schema-to-grammar.cpp. The manipulation results in null pointer dereference. The attack can be launched remotely.

