Skip to main content

llama.cpp CVE-2026-43631

| EUVDEUVD-2026-54286 CRITICAL
Race Condition (CWE-362)
2026-08-06 disclosure@vulncheck.com GHSA-6hc7-9rph-cm99
9.2
CVSS 4.0 · Vendor: vulncheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach exposed llama-server endpoint
  2. Delivery
    Time requests to idle-sleep transition
  3. Exploit
    Trigger vocab pointer free (race)
  4. Execution
    Spray heap to reclaim freed allocation
  5. Persist
    Dereference dangling vocab with controlled data
  6. Impact
    Execute arbitrary code as server process

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Concurrency control, locking
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that llama-server be started with the --sleep-idle-seconds feature enabled - this is the exact configuration prerequisite and it is not a default. The attacker must send requests to reachable llama-server endpoints during the precise moment the server transitions into sleep mode, so success depends on hitting a narrow timing window (reflected as AC:H and AT:P in the CVSS 4.0 vector) and typically requires heap grooming to reclaim the freed vocab allocation with controlled data. Per PR:N/UI:N no authentication or user interaction is needed. Limiting factors: instances without --sleep-idle-seconds are not affected, the race is non-deterministic and may require repeated attempts, and reachability depends on llama-server being network-exposed rather than bound to localhost.

Impact

The signals partially conflict and must be weighed carefully. The CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:N/UI:N with VC:H/VI:H/VA:H) yields a 9.2 CRITICAL score reflecting unauthenticated network-reachable full RCE, but the AC:H and AT:P metrics explicitly encode that success depends on winning a narrow race window during the sleep transition and on the presence of specific runtime conditions - this is not a trivially reliable one-shot exploit. No EPSS score was provided, so real-world exploitation probability cannot be quantified from the input. It is NOT listed in CISA KEV and no POC is referenced, so there is no evidence of active exploitation. Critically, exploitation requires the non-default --sleep-idle-seconds feature to be enabled, which sharply narrows the exposed population versus the raw CRITICAL score. Net: a genuinely severe flaw where it applies, but real-world priority is bounded by the non-default configuration and heap-grooming/timing difficulty; treat as high priority only for operators who run llama-server with idle-sleep enabled on reachable networks.

Exploit ScenarioDerived

An attacker who can reach an internet- or LAN-exposed llama-server instance running with --sleep-idle-seconds enabled floods the completion endpoint precisely as the server begins its idle-to-sleep transition, so a worker thread dereferences the freed vocab pointer. By spraying the heap with crafted request data to reclaim the freed allocation, the attacker steers the dangling pointer to attacker-controlled contents and achieves arbitrary code execution as the server process. No POC is referenced, and the AC:H/AT:P metrics mean the attacker likely needs many timing attempts to win the race.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 06, 2026

Remote code execution in llama.cpp's llama-server (builds b7492 through b9060) allows unauthenticated attackers to run arbitrary code by racing the server's idle-sleep transition when the --sleep-idle-seconds feature is enabled. Concurrent worker threads dereference a freed vocab pointer that can be reclaimed with attacker-controlled data. No public exploit identified at time of analysis, and the flaw is not in CISA KEV; exploitation is gated by a non-default configuration and a tight timing window (CVSS 4.0 base 9.2, AT:P/AC:H).

RemediationAI

No vendor-released patched build version is confirmed in the provided data; the only fix pointer is a third-party GitHub security-patches repository (https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches), so an upstream fix may exist but a released patched build is not independently confirmed - verify against the official ggml-org/llama.cpp releases before relying on a specific build. As an immediate and highly effective compensating control, disable the idle-sleep feature by not passing --sleep-idle-seconds (or setting it so the server never unloads), which removes the vulnerable teardown path entirely at the cost of higher steady-state memory/GPU usage since the model stays resident. Additionally, do not expose llama-server directly to untrusted networks: bind to localhost and place it behind an authenticating reverse proxy or restrict the listening port via firewall to trusted clients, which reduces reachability but does not fix the underlying race. Upgrade to an official patched build as soon as ggml-org confirms one.

Affected VersionsENISA

llama.cpp b7492 ≤b9060

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

llama.cpp is a widely used C/C++ inference engine for running GGUF large language models locally; llama-server is its HTTP serving front-end that exposes completion/embedding endpoints and dispatches requests across worker threads. The root cause is CWE-362 (race condition / improper synchronization of a shared resource): the vocab object owned by the model context is freed as part of the --sleep-idle-seconds idle-unload path, while in-flight worker threads still hold and dereference the now-dangling vocab pointer. This is a classic use-after-free reached through a time-of-check/time-of-use gap between the sleep-transition teardown and concurrent request handling. No CPE strings were supplied in the input, so exact affected configurations are drawn from the description's build-number range rather than an NVD CPE match.

Know when Llama Cpp gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (vulncheck) PRIMARY 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
vuln.today AI 8.1 HIGH

Unauthenticated network RCE (PR:N/UI:N, C/I/A:H) but AC:H because success depends on winning the sleep-transition race; same-process worker corruption means S:U.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 8.1 HIGH

Primary rating from Vendor (vulncheck).

CVSS VectorVendor: vulncheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

A critical vulnerability in llama.cpp's llama-server (builds b7492-b9060) can allow unauthenticated remote attackers to gain unauthorized control over affected systems; no public exploit identified at time of analysis. Organizations deploying this open-source LLM tool with idle-sleep functionality enabled face immediate risk of complete system compromise, data loss, and operational disruption. Rapid identification and remediation of affected deployments is essential.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Disable the --sleep-idle-seconds feature immediately on all affected instances; restrict network access to llama-server to trusted internal subnets only; run llama-server in a containerized environment with minimal host access; monitor vendor communications for patch availability and establish a testing plan for rapid deployment when released.

Threat Intelligence Overview

EPSS Score
0.4%
Top 72% exploitable
Prevalence
High
llama.cpp is one of the most widely deployed local LLM inference engines
Data Quality
9 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.4%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Race conditions occur when multiple concurrent requests exploit the brief time gap between checking a condition and acting upon it (TOCTOU - Time of Check, Time of Use).

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2024-42479 CRITICAL POC
10.0 Aug 12

Arbitrary memory write in llama.cpp's RPC server allows remote unauthenticated attackers to corrupt arbitrary memory add

CVE-2024-21802 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) is possible when a user opens a malicious .gguf model file, triggeri

CVE-2026-21869 HIGH POC
8.8 Jan 08

Llama.cpp server endpoints fail to validate the n_discard parameter from JSON input, allowing negative values that trigg

CVE-2024-21825 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) is possible when a victim loads a malicious .gguf model file, trigge

CVE-2024-23605 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (GGUF library) allows attackers to achieve arbitrary code execution by tricking a use

CVE-2024-23496 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) occurs when the GGUF library's gguf_fread_str function parses a mali

CVE-2024-21836 HIGH POC
8.8 Feb 26

Heap-based buffer overflow in llama.cpp's GGUF library header parser (commit 18c2e17) enables code execution when a vict

CVE-2025-52566 HIGH POC
8.6 Jun 24

CVE-2025-52566 is a signed vs. unsigned integer overflow vulnerability in llama.cpp's tokenizer (llama_vocab::tokenize f

CVE-2026-34159 CRITICAL
9.8 Apr 01

Remote code execution in llama.cpp RPC backend allows unauthenticated attackers with TCP access to achieve arbitrary mem

CVE-2024-42478 MEDIUM POC
5.3 Aug 12

llama.cpp provides LLM inference in C/C++. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable,

CVE-2026-43629 CRITICAL
9.2 Aug 06

Heap buffer overflow in llama.cpp's server KV cache state-restore path (builds b4882 through b9058) lets an attacker who

CVE-2026-43632 CRITICAL
9.2 Aug 06

Use-after-free in the llama-server component of llama.cpp (builds b7492 through b9060) lets remote unauthenticated attac

Vendor StatusVendor

SUSE

Severity: Important

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy