What is CVE-2026-9856?
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.
The record classifies CVE-2026-9856 under weakness class CWE-22. Its CVSS v3 base vector states that the flaw is reachable remotely over the network, needs no prior authentication, needs a user to take an action first, and has high impact on integrity. 1 affected-product entry is recorded, across 1 vendor, listed below. The identifier was first published 64 days ago.
Severity and exploitation probability
- CVSS v3.1 base score
- 7.1 — HIGH
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L - EPSS (FIRST)
- 0.2% probability of exploitation in the next 30 days, higher than 21.8% of all scored CVEs
- CISA KEV
- Not listed in the CISA Known Exploited Vulnerabilities catalog
- Threadlinqs priority
- 4.4/10 — a Threadlinqs composite of the CVSS base score, the EPSS percentile and public exploit availability
- Published
- 2026-08-02, last modified 2026-08-03
Is CVE-2026-9856 being exploited?
It currently carries a trending score of 35 in the Threadlinqs vulnerability feed.
Affected products and versions
- huggingface: huggingface/transformers
How to fix CVE-2026-9856
No vendor patch reference has been recorded for CVE-2026-9856 in the tracked sources. Follow the references below for a fix, and treat the products listed above as exposed until the vendor states otherwise.
Threat activity tracking CVE-2026-9856
No threat campaign in the Threadlinqs corpus currently references CVE-2026-9856, in its CVE list or as an indicator. The linkage is recomputed from the live corpus on every daily ingest, so this section fills in as soon as a tracked campaign cites the identifier.
Sources
Enriched from CVE.org, NVD, FIRST EPSS, GitHub Security Advisories. Last verified by Threadlinqs on . This product uses the NVD API but is not endorsed or certified by the NVD.