CVE-2026-43632: llama.cpp b7492–b9060 Use-After-Free in Tokenization Endpoints
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.
Security readout for executives and security teams
Plain-English summary
A remote, unauthenticated requester may trigger a timing flaw that uses already-freed memory in affected llama.cpp servers. When idle sleeping is enabled, this can crash the service and may permit code execution, threatening availability and the host running it.
Executive priority
Treat as urgent where affected servers use idle sleeping and accept untrusted traffic. Immediately identify and contain those deployments. Other llama.cpp environments need expedited version and configuration checks because the supplied sources do not name a confirmed first fixed build.
Technical view
llama-server builds b7492 through b9060 reportedly let six tokenization handlers access ctx_server.vocab outside the task queue. With --sleep-idle-seconds configured, a time-of-check-time-of-use race can allow the main thread to free vocab while an HTTP worker still uses it, producing a CWE-416 use-after-free.
Likely exposure
Exposure requires an affected llama-server build, --sleep-idle-seconds configuration, and network reachability to at least one named endpoint. Internet-facing or broadly accessible deployments are the highest priority. The supplied evidence does not establish whether default configurations enable the required condition.
Exploitation context
The CVSS 4.0 score is 9.2 with network access, no privileges, and no user interaction, although attack complexity is high and additional attack conditions apply. The CVE is not listed as KEV in the supplied bundle, and no cited evidence confirms active exploitation.
Researcher notes
The reported weakness combines CWE-367 time-of-check-time-of-use behavior with CWE-416 use-after-free. Affected handlers are /tokenize, /detokenize, /infill, /apply-template, /rerank, and /anthropic/count_tokens. Evidence supports crash and potential code execution, but provides neither confirmed exploitation nor detailed proof of code execution.
Mitigation direction
Inventory llama-server deployments and prioritize builds b7492 through b9060.
If operationally feasible, disable --sleep-idle-seconds until remediation is confirmed.
Restrict network access to the six affected endpoints as temporary risk reduction.
Review the referenced mitigation repository and advisory for confirmed remediation guidance.
Apply a vendor-confirmed fixed build when identified, then retest configuration and availability.
Validation and detection
Confirm the exact llama.cpp build identifier for every llama-server deployment.
Inspect startup configuration for --sleep-idle-seconds.
Determine whether any affected endpoint is reachable from untrusted networks.
Review service crashes and memory-fault telemetry for unexplained failures.
Verify remediation against current vendor or advisory guidance without reproducing the race.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-367: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
3Timeline events
1ADP providers
3Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-367 · source CWE mapping
Time-of-check Time-of-use (TOCTOU) Race Condition
Time-of-check Time-of-use (TOCTOU) Race Condition represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.