CVE-2026-9856huggingface/transformers
High 7.1 No auth needed
Follow: this CVE · huggingface · huggingface/transformers We alert you by email or Slack (account required).
- Priority
- 58
- CVSS 3.0
- 7.1
- EPSS
- —
- Auth required
- No
- Published
- Aug 2, 2026
- Updated
- Oct 23, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-22
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: partial
- Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
What happens
A vulnerability in huggingface/transformers versions <=5.8.0.dev0 allows an attacker to perform arbitrary file writes via path traversal. The issue resides in the `save_pretrained()` methods of `PreTrainedTokenizerBase` and `ProcessorMixin`, where keys from the `chat_template` dictionary are used directly as filenames without proper validation. An attacker can exploit this by publishing a malicious Hugging Face Hub repository with a crafted `tokenizer_config.json` file. When a victim downloads and saves the tokenizer or processor, the attacker-controlled keys can escape the intended save directory, enabling arbitrary file writes with attacker-controlled content. This vulnerability affects multiple processors inheriting from `ProcessorMixin`, including Idefics, Florence, Gemma, Phi, and Qwen-VL.
What to do
- Apply the vendor's security update for huggingface/transformers.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | transformers |
< 5.10.0 |
5.10.0 |
pip install "transformers>=5.10.0" |
| PyPI | transformers |
< 5.10.0 |
5.10.0 |
pip install "transformers>=5.10.0" |
Per OSV / GitHub Advisories (GHSA-xrqw-3rrv-vx5w, PYSEC-2026-3929). Check the version in your lockfile before upgrading.
Affected products
- huggingface · huggingface/transformers
As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.
Official sources
References
Links published by the sources. Open them with care.