# CVE-2026-85670: tokenizers BpeBuilder Buffer Overflow via merge token

> CVE-2026-85670: tokenizers BpeBuilder Buffer Overflow via merge token. CVSS 6.5 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2026-85670
Last updated: 2026-09-24T20:28:01Z

- Published: 2026-09-04 14:32 UTC · Updated: 2026-09-24 20:28 UTC · Assigner: VulnCheck
- CVSS: 6.5 (CVSS 3.1) · Severity: Medium · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- EPSS: 0.47%, 40th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-787

## 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.

## Affected vendors and products

- huggingface: tokenizers

## Tracked companies

- [Hugging Face](https://rewindex.com/company/hugging-face.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2026-85670)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2026-85670)
- [https://github.com/huggingface/tokenizers](https://github.com/huggingface/tokenizers)
- [https://github.com/huggingface/tokenizers/blob/v0.23.2/tokenizers/src/models/bpe/model.rs](https://github.com/huggingface/tokenizers/blob/v0.23.2/tokenizers/src/models/bpe/model.rs)
- [https://github.com/huggingface/tokenizers/issues/2094](https://github.com/huggingface/tokenizers/issues/2094)
- [https://www.vulncheck.com/advisories/tokenizers-bpebuilder-buffer-overflow-via-merge-token](https://www.vulncheck.com/advisories/tokenizers-bpebuilder-buffer-overflow-via-merge-token)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2026-85670 · Markdown: https://rewindex.com/cve/CVE-2026-85670.md · JSON: https://rewindex.com/api/v1/cves/CVE-2026-85670 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T02:11:22.040Z
