Horizon Alert
Summary of the vulnerability and why it matters
A use-after-free vulnerability has been identified in certain builds of llama.cpp's llama-server when the `--sleep-idle-seconds` feature is active, potentially allowing unauthenticated remote attackers to execute arbitrary code. This issue arises during the server's transition to sleep mode, where concurrent worker threads may improperly access memory.
- A flaw lets attackers run their own code remotely.
- Affects llama-server code that handles network requests.
- Confirm relevance and exposure of this specific software.
Attack Path
How an attacker could exploit the issue
An attacker could exploit this vulnerability by sending requests to an affected llama-server while it is preparing to enter sleep mode. This timing allows for concurrent worker threads to attempt to access memory that has already been freed. If an attacker can control data that reclaims this freed memory, they can potentially achieve remote code execution.
- Accessible from the network.
- Server enters sleep mode.
- Arbitrary code execution.
Live Threat
Current exploitation, exposure, and threat context
The `llama-server` component, when using the `--sleep-idle-seconds` feature, could allow unauthenticated remote attackers to execute arbitrary code. This may occur when concurrent worker threads attempt to access a vocab pointer that has been freed as the server enters sleep mode, and the pointer is subsequently reclaimed with attacker-controlled data.
- * Affected asset: Server code execution.
- * Exposure: Network requests during sleep transitions.
- * Consequence: Arbitrary code execution.
Operational Fix
Recommended remediation, mitigation, and detection steps
The llama.cpp llama-server component, when the --sleep-idle-seconds feature is enabled, is susceptible to a critical use-after-free vulnerability. This impacts deployments where the server accepts network requests, potentially allowing unauthenticated remote attackers to achieve arbitrary code execution by exploiting the server's transition to sleep mode. Responsibility likely lies with the application owner or platform team managing the llama.cpp instance, with the first practical step being to identify all running instances, confirm their network exposure and business criticality, and then prioritize remediation based on assessed risk.
- Application owners should address the vulnerability.
- Verify network reachability and critical instances.
- Plan remediation based on identified risk.