Description
llama.cpp builds b7492 through the latest b9060 contains a use-after-free vulnerability in llama-server affecting six tokenization endpoints (/tokenize, /detokenize, /infill, /apply-template, /rerank, and /anthropic/count_tokens) that bypass the task queue and access ctx_server.vocab directly on HTTP worker threads. Attackers can exploit a time-of-check-time-of-use race condition where the main thread destroys and frees vocab after the synchronization lock is released but before the handler finishes using it, causing a crash or potential code execution when --sleep-idle-seconds is configured.
Published: 2026-08-06
Score: 9.2 Critical
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a use‑after‑free error located in the llama‑server used by llama.cpp between builds b7492 and b9060. A time‑of‑check/time‑of‑use race allows the main thread to delete the vocabulary shared by the server while an HTTP worker thread is still processing a request, which can cause a crash or, if the coroutine is scheduled to run idle operations, may lead to arbitrary code execution.

Affected Systems

The affected product is llama.cpp from the ggml‑org project. All builds between b7492 and the latest b9060 are impacted, and the flaw is present in six tokenization endpoints: /tokenize, /detokenize, /infill, /apply-template, /rerank, and /anthropic/count_tokens.

Risk and Exploitability

The risk is quantified by a CVSS score of 9.2, indicating high severity. No EPSS score is available, and the vulnerability is not listed in the CISA KEV catalog, so there is no evidence of active exploitation. Attackers can remotely trigger the flaw by issuing HTTP requests to any of the six endpoints while the server is configured with --sleep-idle-seconds, enabling the main thread to free the vocabulary during the request’s processing. This race can result in a service denial or, in certain conditions, local code execution on the host.

Generated by OpenCVE AI on August 7, 2026 at 01:12 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the security patch available at https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches
  • Disable or remove the --sleep-idle-seconds configuration to prevent the vocabulary from being freed while idle
  • Restrict access to the tokenization endpoints to trusted users or networks, and monitor for anomalous requests or crashes

Generated by OpenCVE AI on August 7, 2026 at 01:12 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 06 Aug 2026 22:15:00 +0000

Type Values Removed Values Added
Description llama.cpp builds b7492 through the latest b9060 contains a use-after-free vulnerability in llama-server affecting six tokenization endpoints (/tokenize, /detokenize, /infill, /apply-template, /rerank, and /anthropic/count_tokens) that bypass the task queue and access ctx_server.vocab directly on HTTP worker threads. Attackers can exploit a time-of-check-time-of-use race condition where the main thread destroys and frees vocab after the synchronization lock is released but before the handler finishes using it, causing a crash or potential code execution when --sleep-idle-seconds is configured.
Title llama.cpp b7492–b9060 Use-After-Free in Tokenization Endpoints
Weaknesses CWE-367
CWE-416
References
Metrics cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 9.2, 'vector': '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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-06T15:53:19.379Z

Reserved: 2026-05-01T18:22:45.641Z

Link: CVE-2026-43632

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-07T01:15:05Z

Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

  • CWE-416

    Use After Free