Skip to main content

HuggingFace Transformers EUVDEUVD-2026-52005

| CVE-2026-9856 HIGH
Path Traversal (CWE-22)
2026-08-02 @huntr_ai GHSA-xrqw-3rrv-vx5w
7.1
CVSS 3.0 · Vendor: huntr_ai
Share

Severity by source

Vendor (huntr_ai) PRIMARY
7.1 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
vuln.today AI
7.1 HIGH

Attacker delivers payload via network-hosted Hub repo (AV:N, AC:L, PR:N); victim must explicitly call save_pretrained (UI:R); arbitrary file write yields high integrity impact with no scope change or confidentiality loss.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (huntr_ai).

CVSS VectorVendor: huntr_ai

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
Low

Lifecycle Timeline

4
Source Code Evidence Fetched
Aug 02, 2026 - 16:21 vuln.today
Analysis Generated
Aug 02, 2026 - 16:21 vuln.today
Patch available
Aug 02, 2026 - 16:02 EUVD
CVE Published
Aug 02, 2026 - 15:10 cve.org
HIGH 7.1

DescriptionCVE.org

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.

AnalysisAI

Arbitrary file write via path traversal in HuggingFace Transformers (<=5.8.0.dev0, fixed in 5.10.0) enables a supply-chain attacker to overwrite arbitrary files on a victim's filesystem. The flaw exists in save_pretrained() methods of PreTrainedTokenizerBase and ProcessorMixin, where dictionary keys from the chat_template field in a downloaded tokenizer_config.json are used verbatim as filenames with no path sanitization. An attacker need only publish a malicious model repository on HuggingFace Hub; exploitation is triggered when the victim calls save_pretrained() after loading the poisoned model. No active exploitation is confirmed (not in CISA KEV), but the attack surface spans all practitioners using the affected save_pretrained() path across multiple popular processor families.

Technical ContextAI

The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). In processing_utils.py and tokenization_utils_base.py, the save_pretrained() method serializes multi-template chat_template dictionaries by writing each value to a file named after the key (e.g., <key>.jinja) inside a additional_chat_templates/ subdirectory. Because keys are sourced from a downloaded tokenizer_config.json - attacker-controlled data - a key like ../../etc/cron.d/backdoor will resolve to a path outside the intended save directory. The fix (commit eaaaf8494dd5386634ae37d1d122212fdc315be5) adds a Path.resolve().parent equality check to reject any key whose resolved path does not remain within the designated chat template directory. The vulnerability affects all subclasses of ProcessorMixin (confirmed: Idefics, Florence, Gemma, Phi, Qwen-VL processors) and all tokenizers inheriting from PreTrainedTokenizerBase. The CPE is cpe:2.3:a:huggingface:huggingface/transformers:*:*:*:*:*:*:*:*.

RemediationAI

Upgrade HuggingFace Transformers to version 5.10.0 or later, which includes the path traversal fix from commit eaaaf8494dd5386634ae37d1d122212fdc315be5. The patch details and bounty context are available at https://huntr.com/bounties/362824d5-fe18-40e8-a6cf-62277f97a170 and https://github.com/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d122212fdc315be5. For teams that cannot immediately upgrade, the primary compensating control is to avoid calling save_pretrained() on tokenizers or processors loaded from untrusted or unvetted HuggingFace Hub repositories; restrict model loading to internally mirrored, audited repositories. Additionally, running inference and save operations in a sandboxed environment (e.g., a container with a read-only filesystem outside the designated model directory) will limit the blast radius of a successful exploit. Note that these workarounds impose operational friction for teams with automated model pipelines.

CVE-2024-3568 CRITICAL POC
9.6 Apr 10

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data

CVE-2026-33625 HIGH POC
8.8 Sep 18

Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on Hu

CVE-2023-6730 HIGH POC
8.8 Dec 19

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS

CVE-2023-7018 HIGH POC
7.8 Dec 20

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS

CVE-2025-3262 HIGH POC
7.5 Jul 07

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,

CVE-2026-66007 MEDIUM POC
6.9 Jul 24

Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process

CVE-2026-69112 MEDIUM POC
6.9 Aug 10

Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte

CVE-2026-63086 MEDIUM POC
6.9 Jul 16

Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot

CVE-2025-1194 MEDIUM POC
6.5 Apr 29

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe

CVE-2026-5241 CRITICAL
9.6 Jun 03

Remote code execution in Hugging Face Transformers 5.2.0 allows a malicious model repository to bypass the user's explic

CVE-2025-11844 MEDIUM POC
5.4 Oct 22

XPath injection in Hugging Face Smolagents 1.20.0 lets an attacker who can influence the text passed to the vision web b

CVE-2026-25874 CRITICAL
9.3 Apr 23

Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being

Share

EUVD-2026-52005 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy