External risk intelligence

llama.cpp Use-After-Free via Sleep Idle Threads

CVE advisorySeverity: CRITICAL (CVSS 9.2)

CVE-2026-43631

The vulnerability affects the llama-server component, which is designed to host web and API endpoints. As a server application intended to accept and process network requests, it is commonly deployed in a way that makes it reachable from the network, aligning with an internet-facing or edge-accessible service model.

Use After Free

Ggml Llama Cpp

b7492 to b9060

Halo Surface Signal: 4 out of 5 — likely to be public-facing.

External exposure likelihood

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.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is llama.cpp and the llama-server component?

llama.cpp is a software library designed to enable the efficient inference of Large Language Models on consumer-grade hardware. The llama-server component serves as a specialized interface within this project, providing a web and API-based environment that allows applications to interact with these models over a network.

What is the vulnerability in CVE-2026-43631?

This vulnerability is a use-after-free, classified as CWE-416. It occurs when a program continues to use a pointer to memory after that memory has been released or freed. In this specific case, llama-server prematurely frees a vocabulary pointer while worker threads are still active, creating a memory safety flaw that could allow an attacker to run their own malicious code.

How can an attacker trigger this vulnerability?

An attacker must send network requests to the server precisely while it is transitioning into sleep mode, a state controlled by the --sleep-idle-seconds feature. If the feature is disabled, the specific code path that triggers this memory error is not invoked, and the vulnerability cannot be exploited through this method.

Is my llama-server instance at risk?

According to Halo Surface Signal, this software is designed to host API endpoints, making it frequently accessible from the network. If your deployment allows external traffic to reach the llama-server component while the idle sleep setting is active, it is categorized as an internet-facing service and carries a higher risk profile.

What should I do if I am running affected software?

Your first step is to perform an inventory of all llama-server instances to identify which ones have the --sleep-idle-seconds configuration enabled. Once identified, evaluate the network accessibility and business importance of these specific instances to prioritize your security response and necessary updates.

References