CVE-2026-9856 json
Path Traversal in huggingface/transformers
published 3mo ago modified 19d ago also GHSA-xrqw-3rrv-vx5w , PYSEC-2026-3929 , EUVD-2026-52005
- cvss
- 7.1
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 40%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi transformers 5.10.0
- huggingface huggingface/transformers 5.10.0
- github.com/huggingface/transformers@eaaaf84 commit
- github.com/huggingface/transformers#46191 pull request
Is CVE-2026-9856 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-9856 updated cvss 8.1
transformers: Hugging Face Transformers: Arbitrary file write via path traversal
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 3mo ago
Exploit prediction
0.46% chance of exploitation in the next 30 days, higher than 40% of all scored CVEs (FIRST EPSS, 2026-11-11).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 7.1 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L |
| OSV | 3.0 | 7.1 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L |
| GitHub | 3.0 | 7.1 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | transformers | <5.10.0 |
5.10.0 |
Affected products
- huggingface huggingface/transformers
Classification
- Weakness
-
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
References
-
github.com
/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d122212fdc315be5
web
-
github.com
/huggingface/transformers/pull/46191
web
-
huntr.com
/bounties/362824d5-fe18-40e8-a6cf-62277f97a170
web
-
nvd.nist.gov
/vuln/detail/CVE-2026-9856
advisory
-
github.com
/huggingface/transformers
package
-
pypi.org
/project/transformers
package
-
github.com
/advisories/GHSA-xrqw-3rrv-vx5w
advisory
Sources
- CVE List CVE-2026-9856
- GitHub Advisory GHSA-xrqw-3rrv-vx5w
- NVD CVE-2026-9856
- OSV PYSEC-2026-3929
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.