Out-of-Bounds Buffer Access Vulnerability in Hugging Face Tokenizers
CVE-2026-85670
7.1HIGH
What is CVE-2026-85670?
The tokenizers product from Hugging Face is vulnerable to an out-of-bounds buffer access caused by improper handling of data in the BpeBuilder::build function. When a specially crafted tokenizer.json file is loaded through Tokenizer::from_file or Tokenizer::from_str, the builder initializes a buffer based on the longest vocabulary key. If a merge rule exceeds this limit, it can lead to a buffer overrun, causing a denial of service due to a process panic in Rust. Additionally, there is a risk of memory corruption when certain conditions are met, highlighting a critical area for concern for users depending on this library.
Affected Version(s)
tokenizers 0 <= 0.23.2
