CVE-2026-43631
Description
A flaw was found in llama.cpp. This use-after-free vulnerability in the llama-server component, specifically within the vocab pointer when the --sleep-idle-seconds feature is enabled, allows unauthenticated remote attackers to execute arbitrary code. Attackers can exploit this by sending requests while the server transitions to sleep mode, leading to concurrent worker threads to dereference a freed memory region. This can be reclaimed with attacker-controlled data, resulting in remote code execution.
Statement
Exploitation requires sending network requests to the HTTP server during the specific, narrow window when the service transitions into an idle sleep state. If successfully timing the race condition, an unauthenticated attacker could corrupt server memory to achieve full compromise across Confidentiality, Integrity, and Availability (C:H, I:H, A:H) within the process privilege context. Deployments operating without automated idle-sleep timeouts enabled, CLI tool invocations, or non-server API environments are completely unaffected by this flaw.
Mitigation
To mitigate this vulnerability, disable the `--sleep-idle-seconds` feature in the llama-server configuration. This feature is a prerequisite for the vulnerability to be exploited. Consult the llama.cpp documentation for specific instructions on disabling server features. A restart of the llama-server may be required for the changes to take effect.
Understanding the Weakness (CWE)
Confidentiality
Technical Impact: Read Memory
If the expired pointer is used in a read operation, an attacker might be able to control data read in by the application.
Availability
Technical Impact: DoS: Crash, Exit, or Restart
If the expired pointer references a memory location that is not accessible to the product, or points to a location that is "malformed" (such as NULL) or larger than expected by a read or write operation, then a crash may occur.
Integrity,Confidentiality,Availability
Technical Impact: Execute Unauthorized Code or Commands
If the expired pointer is used in a function call, or points to unexpected data in a write operation, then code execution may be possible.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.