A vulnerability in huggingface/transformers versions <=5.8.0.dev0 allows an attacker to perform arbitrary file writes via path traversal. (CVE-2026-9856)
A path traversal vulnerability in huggingface/transformers versions up to 5.8.0.dev0 allows attackers to perform arbitrary file writes. The flaw exists in the save_pretrained() methods of PreTrainedTokenizerBase and ProcessorMixin, where keys from a chat_template dictionary are used as filenames without validation. Maliciously crafted tokenizer_config.json files in Hugging Face Hub repositories can exploit this when downloaded and saved by victims. Multiple processors inheriting from ProcessorMixin are affected, including Idefics, Florence, Gemma, Phi, and Qwen-VL. The vulnerability has a high severity score of 7.1.
AI Analysis
Technical Summary
The vulnerability (CVE-2026-9856) affects huggingface/transformers versions <=5.8.0.dev0. It arises from improper validation of keys used as filenames in the save_pretrained() methods of PreTrainedTokenizerBase and ProcessorMixin classes. An attacker can publish a malicious repository on the Hugging Face Hub containing a crafted tokenizer_config.json file with keys that escape the intended save directory via path traversal. When a victim downloads and saves the tokenizer or processor, arbitrary files can be written with attacker-controlled content. This impacts multiple processors inheriting from ProcessorMixin, such as Idefics, Florence, Gemma, Phi, and Qwen-VL. The CVSS v3.0 score is 7.1, indicating a high severity vulnerability with network attack vector, low attack complexity, no privileges required, user interaction required, unchanged scope, no confidentiality impact, high integrity impact, and low availability impact.
Potential Impact
Successful exploitation allows an attacker to write arbitrary files on the victim's filesystem outside the intended directory. This can lead to integrity violations by overwriting or creating files with attacker-controlled content. There is no direct confidentiality impact reported. The attack requires the victim to download and save a malicious tokenizer or processor from a crafted Hugging Face Hub repository. Availability impact is low.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, users should avoid downloading and saving tokenizers or processors from untrusted or unknown Hugging Face Hub repositories. Monitor official Hugging Face channels for updates or patches addressing this vulnerability.
A vulnerability in huggingface/transformers versions <=5.8.0.dev0 allows an attacker to perform arbitrary file writes via path traversal. (CVE-2026-9856)
Description
A path traversal vulnerability in huggingface/transformers versions up to 5.8.0.dev0 allows attackers to perform arbitrary file writes. The flaw exists in the save_pretrained() methods of PreTrainedTokenizerBase and ProcessorMixin, where keys from a chat_template dictionary are used as filenames without validation. Maliciously crafted tokenizer_config.json files in Hugging Face Hub repositories can exploit this when downloaded and saved by victims. Multiple processors inheriting from ProcessorMixin are affected, including Idefics, Florence, Gemma, Phi, and Qwen-VL. The vulnerability has a high severity score of 7.1.
CVSS v3.0
Score 7.1high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability (CVE-2026-9856) affects huggingface/transformers versions <=5.8.0.dev0. It arises from improper validation of keys used as filenames in the save_pretrained() methods of PreTrainedTokenizerBase and ProcessorMixin classes. An attacker can publish a malicious repository on the Hugging Face Hub containing a crafted tokenizer_config.json file with keys that escape the intended save directory via path traversal. When a victim downloads and saves the tokenizer or processor, arbitrary files can be written with attacker-controlled content. This impacts multiple processors inheriting from ProcessorMixin, such as Idefics, Florence, Gemma, Phi, and Qwen-VL. The CVSS v3.0 score is 7.1, indicating a high severity vulnerability with network attack vector, low attack complexity, no privileges required, user interaction required, unchanged scope, no confidentiality impact, high integrity impact, and low availability impact.
Potential Impact
Successful exploitation allows an attacker to write arbitrary files on the victim's filesystem outside the intended directory. This can lead to integrity violations by overwriting or creating files with attacker-controlled content. There is no direct confidentiality impact reported. The attack requires the victim to download and save a malicious tokenizer or processor from a crafted Hugging Face Hub repository. Availability impact is low.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, users should avoid downloading and saving tokenizers or processors from untrusted or unknown Hugging Face Hub repositories. Monitor official Hugging Face channels for updates or patches addressing this vulnerability.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-xrqw-3rrv-vx5w
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-9856"]
- Ecosystems
- []
- Database Specific Severity
- HIGH
- Cvss Version
- 3.0
Threat ID: 6a6fb62abf32cb7a346e6bfb
Added to database: 08/02/2026, 21:27:06 UTC
Last enriched: 08/02/2026, 21:28:25 UTC
Last updated: 08/03/2026, 03:17:46 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.