CVE-2026-85670: Out-of-bounds Write in huggingface tokenizers
Description
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.
CVSS v4.0
Score 7.1high
Affected software
huggingface
tokenizers
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Hugging Face tokenizers (version 0.23.1) arises from an out-of-bounds buffer access in BpeBuilder::build during tokenizer.json loading. The scratch buffer is sized to the longest vocabulary key, but a merge rule with a concatenated token longer than this key causes a buffer overflow, leading to a Rust panic that aborts the process. Additionally, if the continuing_subword_prefix option is enabled and a merge token is shorter than this prefix, a usize underflow can occur, causing a panic in debug mode and potential memory corruption in release mode. This vulnerability can be exploited by supplying a malicious tokenizer.json file, resulting in denial of service at load time without requiring token encoding.
Potential Impact
An attacker who can supply a crafted tokenizer.json file can cause the tokenizers process to panic and abort, resulting in a denial of service. The secondary defect may lead to memory corruption in release builds, potentially causing undefined behavior or crashes. There is no indication of code execution or data leakage. No known exploits are reported in the wild.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid loading untrusted or unauthenticated tokenizer.json files to prevent denial of service. Monitor official Hugging Face channels for updates or patches addressing this vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-09-04T13:32:36.617Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a9adb45acd9273b49bef597
Added to database: 09/04/2026, 14:52:53 UTC
Last enriched: 09/07/2026, 12:02:52 UTC
Last updated: 10/17/2026, 18:48:23 UTC
Views: 69
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.