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
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Publish malicious Hub repo with crafted tokenizer_config.json
  2. Delivery
    Victim loads poisoned tokenizer via from_pretrained()
  3. Exploit
    Victim calls save_pretrained() on loaded tokenizer
  4. Execution
    Path traversal in chat_template key bypasses directory boundary
  5. Impact
    Attacker-controlled content written to arbitrary filesystem path

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The victim must call save_pretrained() on a tokenizer (subclass of PreTrainedTokenizerBase) or processor (subclass of ProcessorMixin) that was loaded from an attacker-controlled or attacker-influenced HuggingFace Hub repository. The chat_template field in the downloaded tokenizer_config.json must be a dictionary (dict-form multi-template), not a plain string - the single-string form is not vulnerable. The process running save_pretrained() must have write access to the target path outside the save directory for the traversal to cause damage. Exploitation is limited by the UI:R requirement: a human or automated script must explicitly call save_pretrained() after loading the model, and the victim must download from the attacker's repository (requiring either direct use of the malicious repo name or a dependency/namespace-squatting scenario). Filesystem permissions on the victim system bound the worst-case write target.

Impact

The CVSS 3.0 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L, score 7.1) accurately captures the threat model: network-delivered via a malicious Hub repository, no complexity or privilege requirement on the attacker side, but requiring explicit user interaction (UI:R) to call save_pretrained(). The high integrity impact reflects the ability to write attacker-controlled content to any path the victim process has write access to - potentially overwriting shell configs, SSH authorized_keys, or cron jobs. No EPSS data was provided in the source intelligence. There is no CISA KEV listing, and no independently confirmed public proof-of-concept exploit beyond the huntr.com bounty disclosure. Despite the absence of confirmed active exploitation, the realistic risk is elevated: ML practitioners routinely run from_pretrained() followed by save_pretrained() in automated pipelines and notebooks, often with minimal vetting of Hub model provenance. The discrepancy between the CVE-stated upper bound (<=5.8.0.dev0) and EUVD-stated bound (<5.10.0) should be noted - treat 5.10.0 as the authoritative safe version per EUVD.

Exploit ScenarioDerived

An attacker creates a HuggingFace Hub repository containing a tokenizer_config.json where the chat_template field is a dictionary with a malicious key such as ../../.ssh/authorized_keys, mapped to attacker-controlled SSH public key content. When a victim's automated ML pipeline calls AutoTokenizer.from_pretrained('attacker/malicious-model') followed by tokenizer.save_pretrained('/workspace/models/my-model'), the library writes the attacker's content to /workspace/models/my-model/additional_chat_templates/../../.ssh/authorized_keys, resolving to the victim's SSH authorized_keys file and granting the attacker remote access. No public proof-of-concept exploit has been independently confirmed beyond the huntr.com disclosure.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 02, 2026

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.

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.

Affected VersionsENISA

huggingface/transformers unspecified <5.10.0

Affected Packages

pypi transformers fix: 5.10.0
euvd huggingface_transformers_unspecified fix: 5.10.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in pypi, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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:*:*:*:*:*:*:*:*.

Know when Hugging Face gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

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
Red Hat 8.1 HIGH

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

2
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.

Executive ViewAI

Why It Matters

HuggingFace Transformers versions through 5.8.0.dev0 contain a critical supply-chain vulnerability enabling attackers to overwrite arbitrary files on users' systems by publishing poisoned model repositories on HuggingFace Hub. Organizations and practitioners using affected versions face immediate risk of system compromise and data loss through save_pretrained() operations; while no public exploit is currently identified, the attack surface spans the entire practitioner community. A vendor patch (version 5.10.0) is available and must be deployed urgently.

Business Impact: High
Compensating Controls

Apply vendor patch: HuggingFace Transformers 5.10.0 or later.

Threat Intelligence Overview

EPSS Score
0.3%
Top 78% exploitable
Prevalence
High
dominant open-source ML library with tens of millions of monthly downloads
Threat Intel
1
1 sources
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

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-25874 CRITICAL POC
9.3 Apr 23

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

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-2026-57845 HIGH POC
8.7 Oct 23

Deserialization of attacker-supplied pickle data in the deprecated pandas packaged builder of Hugging Face Datasets (all

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-2025-6921 HIGH POC
7.5 Sep 23

The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (R

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-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-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-2025-1194 MEDIUM POC
6.5 Apr 29

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

Vendor StatusVendor

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