Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker crafts malicious tokenizer.json with oversized merge rule
-
DeliveryServes file via HuggingFace Hub or compromised model registry
-
ExploitVictim pipeline calls Tokenizer::from_file on crafted artifact
-
InstallBpeBuilder::build allocates undersized scratch buffer
-
C2Merge concatenation exceeds buffer boundary
-
ExecuteRust OOB write triggers process-aborting panic
-
ImpactInference service crashes (DoS)
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, 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 a victim application call Tokenizer::from_file or Tokenizer::from_str with an attacker-influenced tokenizer.json file. No authentication, encoding step, or special runtime state is needed beyond the load call itself - the crash fires deterministically at deserialization time. The primary out-of-bounds condition is met when any BPE merge rule in the file produces a concatenated token longer than the longest key in the vocabulary dictionary. The secondary usize underflow additionally requires the continuing_subword_prefix field to be set in the tokenizer configuration and at least one merge token to be shorter than that prefix; memory corruption (beyond panic) from the secondary path occurs only in release builds compiled without Rust overflow checks. Applications that exclusively load tokenizer.json files from internally controlled, integrity-verified sources are not at practical risk from an external attacker. |
| Impact | The CVSS 4.0 score of 7.1 (AV:N/AC:L/AT:N/PR:N/UI:P/VA:H) accurately captures a network-reachable, low-complexity availability impact gated only on a passive load action - a realistic trigger in any ML pipeline that fetches model configurations from HuggingFace Hub, private mirrors, or user-supplied paths. The UI:P designation is the principal limiting factor: the victim process must actively call Tokenizer::from_file or from_str on the crafted file, but automated model-loading pipelines frequently do this without human review. EPSS data was not provided, and the vulnerability is absent from the CISA KEV catalog, indicating no confirmed active exploitation; real-world prioritization should reflect this. The secondary memory-corruption risk in release builds introduces a theoretical severity escalation beyond DoS, but this is stated in the CVE description rather than confirmed by a formal vendor security analysis - even a mid-sized ML operations team in kalisz running automated model ingestion pipelines should weigh this uncertainty carefully and treat it as an elevated-priority patch given the zero-encoding-required trigger. The automatable load-time exploitation path, combined with the ubiquity of community-sourced tokenizer.json files in HuggingFace Hub workflows, makes the real-world attack surface meaningfully larger than the CVSS UI:P modifier alone suggests. |
| Exploit ScenarioDerived | An attacker publishes a model on HuggingFace Hub - or serves one from a compromised internal model registry - with a tokenizer.json file containing a BPE merge rule whose concatenated token string is longer than the longest vocabulary key. Any inference service, fine-tuning job, or evaluation pipeline that calls Tokenizer::from_file on this artifact immediately aborts with a Rust panic at model-load time, before any tokenization or inference occurs. In a Kubernetes-hosted inference deployment configured to auto-reload models, the attacker can sustain repeated service crashes by keeping the malicious artifact accessible, causing extended downtime. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 04, 2026
Out-of-bounds write in Hugging Face tokenizers v0.23.1 allows any actor who can supply a crafted tokenizer.json file to abort the loading process immediately, causing denial of service in Rust applications and FFI embeddings before any inference occurs. The defect in BpeBuilder::build (tokenizers/src/models/bpe/model.rs) allocates a scratch buffer sized to the longest vocabulary key, then writes concatenated BPE merge pairs into it without bounding the write to the buffer size; a merge whose result exceeds that length triggers a Rust panic and process abort (CWE-787). A secondary usize underflow at the same code site, activated when continuing_subword_prefix is set and a merge token is shorter than the prefix, produces a panic in debug builds and potential memory corruption in release builds, elevating the secondary impact beyond availability alone. No public exploit code or CISA KEV listing has been identified at time of analysis; a fix appears in the v0.23.2 source.
RemediationAI
Upgrade to tokenizers v0.23.2 or later, which is referenced by the fix commit at https://github.com/huggingface/tokenizers/blob/v0.23.2/tokenizers/src/models/bpe/model.rs; note that this version reference is inferred from the source URL rather than a formally published security release, so confirm the exact tagged release before deploying. Rust consumers should run 'cargo update tokenizers' and pin to a version at or above v0.23.2; Python consumers should run 'pip install --upgrade tokenizers'. As an immediate compensating control for pipelines that cannot patch immediately, restrict tokenizer.json ingestion to fully trusted, internally validated model repositories and reject externally- or user-supplied tokenizer configurations; this eliminates the attacker-controlled input vector entirely. For environments where continuing_subword_prefix is used, disable or constrain that feature when processing untrusted tokenizer files to mitigate the secondary underflow risk. Adding a pre-load schema validation step that confirms no merge rule concatenation exceeds the longest vocabulary key length would provide defense-in-depth independent of the upstream fix.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The Hugging Face tokenizers library (cpe:2.3:a:huggingface:tokenizers:*:*:*:*:*:*:*:*) implements Byte Pair Encoding (BPE) tokenization used extensively in transformer-based NLP models. The BpeBuilder::build function in tokenizers/src/models/bpe/model.rs pre-allocates a scratch buffer by scanning the vocabulary for the longest key, then iterates over the merge list, concatenating each token pair into that buffer. CWE-787 (Out-of-Bounds Write) manifests when a concatenated merge pair exceeds the pre-allocated buffer length - Rust's bounds checker detects this at runtime and converts the out-of-bounds access into a panic, which aborts the process. Because the flaw fires at deserialization time (Tokenizer::from_file or Tokenizer::from_str), no model inference step is required to trigger it. The secondary defect involves a usize (unsigned integer) underflow when computing an offset using continuing_subword_prefix: in debug builds Rust panics on underflow; in release builds (where overflow checks are omitted by default), the underflow wraps and can corrupt adjacent heap memory.
Know when Tokenizers 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
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
AV:N because attacker delivers crafted file over network; UI:R for required load action; A:H for deterministic process abort; I:N as release-build memory corruption is unconfirmed.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
tokenizers (Hugging Face) is affected by an out-of-bounds buffer access in BpeBuilder::build (tokenizers/src/models/bpe/model.rs). When loading a tokenizer.json via Tokenizer::from_file/from_str, the builder sizes a scratch buffer to the longest vocabulary key, then writes each concatenated merge rule into it. A merge whose concatenated token exceeds the longest vocabulary key overruns the buffer, which Rust turns into a panic that aborts the process in Rust and FFI embeddings. This occurs at load time with no encoding required, so an attacker who supplies a crafted tokenizer.json can cause a denial of service. A secondary defect at the same location can cause a usize underflow (panic in debug, potential memory corruption in release) when continuing_subword_prefix is set and a merge token is shorter than the prefix. Observed in version 0.23.1.
Executive ViewAI
Hugging Face tokenizers v0.23.1 contains an out-of-bounds write vulnerability in the BPE model builder triggered by maliciously crafted tokenizer configuration files, causing application crashes (denial of service) and potential memory corruption in release builds. Organizations using this library to load tokenizer files face disruption to ML inference services and potential data integrity risks if untrusted configurations are processed.
Vendor-released patch: v0.23.2. Until patching is complete, restrict tokenizer.json loading to known trusted sources only and implement file-level validation or sandboxing of the tokenizer loading process.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
EUVD-2026-71126
GHSA-jrf5-f6jp-7vxc
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB