> CVE-2026-9856 [HIGH]

« BACK_TO_HOME
PUBLISHED
2026-08-02 16:16
MODIFIED
2026-08-02 16:16
CVSS_SCORE V3
7.1
EPSS (Prob. Exploit)
0.46%
Top 60.1%
DATA SOURCES:
NVD 🔗 2026-08-02 CWE MITRE 🔗 2026-11-01 FIRST EPSS 🔗 2026-11-01 GITHUB 🔗 2026-10-29 OSV 🔗 2026-11-02

> DESCRIPTION

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.

> AFFECTED_PRODUCTS

ℹ️ Aucun produit affecté n'a encore été publié par NVD pour cette CVE.

> CVSS V3 METRICS

CVSS_VECTOR
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
EXPLOITABILITY
2.8
IMPACT
4.2

> MÉTRIQUES CVSS DÉTAILLÉES

CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
Métrique Valeur Interprétation
AV (Vecteur d'Attaque)
Attack Vector
Network (N)
Exploit possible à distance via réseau (HTTP, API, etc.)
AC (Complexité d'Attaque)
Attack Complexity
Low (L)
Peu de conditions requises pour exploiter
PR (Privilèges Requis)
Privileges Required
None (N)
Aucune authentification requise
UI (Interaction Utilisateur)
User Interaction
Required (R)
Nécessite une action utilisateur (clic lien, ouverture fichier, etc.)
S (Périmètre)
Scope
Unchanged (U)
Impact reste dans le périmètre du composant compromis
C (Impact Confidentialité)
Confidentiality Impact
None (N)
Aucune divulgation d'informations
I (Impact Intégrité)
Integrity Impact
High (H)
Modification totale des données possible
A (Impact Disponibilité)
Availability Impact
Low (L)
Interruption partielle du service possible

> RÉSUMÉ DES IMPACTS

Confidentialité
None
Aucune divulgation d'informations
Intégrité
High
Modification totale des données possible
Disponibilité
Low
Interruption partielle du service possible

> WEAKNESSES

CWE-22

> CWE DETAILED DESCRIPTIONS

CWE-22: Improper Limitation of a Pathname to a Restricted Directory - The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

> GITHUB SECURITY ADVISORY

GHSA-xrqw-3rrv-vx5w HIGH

Transformers save_pretrained path traversal allows arbitrary file writes through chat template names

AFFECTED PACKAGES:
PIP / transformers
< 5.10.0
Fixed in: 5.10.0

> OSV (GOOGLE OPEN SOURCE VULNERABILITIES)

Path Traversal in huggingface/transformers

AFFECTED PACKAGES:
Unknown / Unknown
85 versions affected
ALIASES:
GHSA-xrqw-3rrv-vx5w, PYSEC-2026-3929

> HISTORIQUE DES MODIFICATIONS

Première apparition
02/08/2026 16:16
Source: NVD
📊 ENRICHISSEMENT 01/11/2026 06:59
CWE
Champ modifié: Description CWE
Ancienne valeur:
CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') - The product uses external input to construct a pathname that is intended to identify a file or directory that i...
Nouvelle valeur:
CWE-22: Improper Limitation of a Pathname to a Restricted Directory - The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneat...
📊 ENRICHISSEMENT 01/09/2026 06:02
CWE
Champ modifié: Description CWE
Ancienne valeur:
N/A
Nouvelle valeur:
CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') - The product uses external input to construct a pathname that is intended to identify a file or directory that i...
Total des modifications: 2 Dernière mise à jour: 3 days ago

> REFERENCES

https://github.com/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d1222...
https://huntr.com/bounties/362824d5-fe18-40e8-a6cf-62277f97a170
« BACK_TO_HOME