CVE-2026-9856

Source
https://cve.org/CVERecord?id=CVE-2026-9856
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-9856.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-9856
Published
2026-08-02T15:10:53.809Z
Modified
2026-08-04T05:34:32.929366255Z
Severity
  • 7.1 (High) CVSS_V3 - CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L CVSS Calculator
Summary
Path Traversal in huggingface/transformers
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-22"
    ],
    "cna_assigner": "@huntr_ai",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/9xxx/CVE-2026-9856.json",
    "unresolved_ranges": [
        {
            "source": "AFFECTED_FIELD",
            "extracted_events": [
                {
                    "fixed": "5.10.0"
                }
            ]
        }
    ]
}
References

Affected packages

Git / github.com/huggingface/transformers

Affected ranges

Type
GIT
Repo
https://github.com/huggingface/transformers
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Database specific
{
    "source": "REFERENCES"
}

Affected versions

0.*
0.1.2
0.5.0
1.*
1.0
1.1.0
1.2.0
3.*
3.0.1
4.*
4.3.0.rc1
4.55.0-GLM-4.5V-preview
4.55.0-GLM-4.5V-preview-GLM-4.5V-preview
v0.*
v0.1.2
v0.2.0
v0.3.0
v0.4.0
v0.5.0
v0.5.1
v0.6.0
v0.6.1
v0.6.2
v2.*
v2.0.0
v2.1.0
v2.1.1
v2.10.0
v2.11.0
v2.2.0
v2.2.1
v2.2.2
v2.3.0
v2.4.0
v2.4.1
v2.5.0
v2.5.1
v2.6.0
v2.7.0
v2.8.0
v2.9.0
v2.9.1
v3.*
v3.0.0
v3.0.1
v3.0.2
v3.1.0
v3.2.0
v3.3.0
v3.3.1
v3.4.0
v3.5.0
v4.*
v4.1.0
v4.1.1
v4.10.0
v4.11.0
v4.12.0
v4.13.0
v4.14.0
v4.15.0
v4.16.0
v4.2.0
v4.3.0.rc1
v4.33.1
v4.4.0
v4.49.0-AyaVision
v4.49.0-Mistral-3
v4.49.0-SigLIP-2
v4.49.0-SmolVLM-2
v4.5.0
v4.50.3-DeepSeek-3
v4.51.3-BitNet-preview
v4.51.3-CSM-preview
v4.51.3-D-FINE-preview
v4.51.3-GraniteMoeHybrid-preview
v4.51.3-InternVL-preview
v4.51.3-Janus-preview
v4.51.3-LlamaGuard-preview
v4.51.3-MLCD-preview
v4.51.3-Qwen2.5-Omni-preview
v4.51.3-SAM-HQ-preview
v4.51.3-TimesFM-preview
v4.52.4-ColQwen2-preview
v4.52.4-Kyutai-STT-preview
v4.52.4-VJEPA-2-preview
v4.53.2-Ernie-4.5-preview
v4.53.2-modernbert-decoder-preview
v4.56.1-Vault-Gemma-preview
v4.6.0
v4.7.0
v4.8.0
v4.9.0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-9856.json"