Summary
CVE-2026-43631 is a use-after-free vulnerability in the llama-server component of llama.cpp (ggml-org). When the --sleep-idle-seconds feature is enabled, concurrent worker threads dereference a freed vocab pointer that can be reclaimed with attacker-controlled data, allowing an unauthenticated remote attacker to execute arbitrary code. It is rated Critical (CVSS v4.0 base score 9.2).
Technical details
- Root cause: Use-after-free (CWE-416) combined with a race condition (CWE-362) affecting the vocab pointer in
llama-server. - Trigger conditions: The
--sleep-idle-secondsfeature must be enabled; the flaw is reachable as the server transitions to sleep mode while concurrent worker threads are active. - Attack vector: Network. No authentication or user interaction is required; attack complexity is high.
- Impact: Concurrent worker threads dereference a freed vocab pointer that can be reclaimed with attacker-controlled data, leading to remote code execution with high impact to confidentiality, integrity, and availability.
Affected software
- llama.cpp
llama-server, builds b7492 through b9060 (inclusive).
Severity
- CVSS v4.0: 9.2 (Critical) —
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS v3.1: 8.1 (High) —
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: Upgrade llama.cpp to a build later than b9060 that includes the fix; refer to the published security patches.
- If no patch: Disable the
--sleep-idle-secondsfeature, and restrict network access tollama-serverso it is not exposed to untrusted networks.

