Disclosed weakness · no CVE recorded
Transformers could ignore a tokenizer’s configured control-token sanitization
Hugging Face · Transformers tokenizer and processor chat templates
First documented disclosure · Review checkpoint
Summary
A model’s configured sanitization default could be ignored when converting untrusted chat content into tokenized input.
Severity and exploitation evidence
No CVSS score recorded in this review.
Exploitation not established: The reviewed public original establishes a reported correction or controlled source-level comparison, not malicious exploitation or identified victims. No product, model, exploit or proof of concept was executed in this review.
Technical severity is not a measure of observed attacks or of risk to your deployment. Attempts, demonstrations, and successful compromise retain the qualifications in the source.
How the weakness works
apply_chat_template defaulted its sanitization argument to false and did not load the tokenizer configuration setting. A control-token string in user content could therefore become a control token despite the model setting requesting ordinary-text encoding.
Conditions required
An application calls tokenizer or processor apply_chat_template with untrusted content, relies on sanitize_control_tokens=true in tokenizer_config.json, omits the explicit argument and requests compatible tokenized output.
Potential impact
The configured separation between user text and template control tokens can fail. The upstream comparison shows an extra control token; no particular model response, code execution or data theft is established.
Affected versions and configurations
Tagged 5.25.0 retains the false argument default and lacks the configuration-property loading. The original report also identifies main commit 626e62ef889c9b77c4d1425e076b17ee098ae925; the full affected release range is unverified.
Fix and mitigation status
5.25.1 stable, released December 2, contains PR 51599. The configured default applies to tokenized output without assistant-token masks; text output and assistant-mask requests keep their existing unsanitized default. Explicit true or false still takes precedence.
Practical next steps
Update to a corrected release or explicitly request sanitization on supported tokenized calls. Validate the tokenizer’s configuration and do not assume text output, assistant-mask output or tokenizers without the setting are sanitized.
Operating lesson
A security option in a model configuration must reach the execution path that constructs model input.
Evidence and limits
The full PR, single December 1 corrective commit, complete diff and 5.25.0/5.25.1 tagged code were reviewed. PR 51599 opened December 1 at 20:12:10Z and merged December 2 at 16:59:42Z. Its December 1 commit and title describe this configuration-default correction; the later stable release does not reset that original public date. The author’s Ergo-tokenizer comparison and tiny-tokenizer regression remain attributed, not independently executed. No model weights were downloaded. This is distinct from the separately indexed template-object sandbox and DeBERTa normalization changes. No CVE or numeric severity is assigned.
Sources
- Original configuration-default report and correction
Primary source ·
- Original corrective commit
Primary source ·
- Stable 5.25.1 release
Primary source ·
- Corrected tokenizer implementation
Primary source ·
- Corrected processor implementation
Primary source ·
- Earlier stable implementation comparison
Primary source ·