{"id":"CVE-2026-85670","aliases":["CVE-2026-85670"],"related":[],"kind":"vulnerability","state":"published","title":"tokenizers BpeBuilder Buffer Overflow via merge token","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"}],"published":"2026-09-04T14:32:25.391Z","modified":"2026-09-24T20:28:01.780Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"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","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"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","score":7.1,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"type":"semver","introduced":"0","lastAffected":"0.23.2","status":"affected"}],"vendor":"huggingface","product":"tokenizers","source":"cvelist"}],"references":[{"url":"https://github.com/huggingface/tokenizers/issues/2094","tags":["exploit","issue-tracking"],"sources":["cvelist","nvd"]},{"url":"https://github.com/huggingface/tokenizers","tags":["product"],"sources":["cvelist","nvd"]},{"url":"https://github.com/huggingface/tokenizers/blob/v0.23.2/tokenizers/src/models/bpe/model.rs","tags":["technical-description"],"sources":["cvelist","nvd"]},{"url":"https://www.vulncheck.com/advisories/tokenizers-bpebuilder-buffer-overflow-via-merge-token","tags":["third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":["George Chen"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-09-04T17:49:21.636Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-85670","url":"https://www.cve.org/CVERecord?id=CVE-2026-85670","licence":"CVE Terms of Use","modified":"2026-09-04T17:49:42.263Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-85670","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-85670","licence":"Public domain","modified":"2026-09-24T20:28:01.780Z"}],"updatedAt":"2026-11-25T22:59:36.299Z","epss":{"score":0.0031,"percentile":0.25759,"date":"2026-12-01T12:00:22.000Z"}}