{"id":"CVE-2026-9856","published":"2026-08-02T15:10:53Z","modified":"2026-08-03T14:57:43Z","title":"Path Traversal in huggingface/transformers","vendor":"huggingface","product":"huggingface/transformers","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.1,"severity":"HIGH","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0046,"percentile":0.40729,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://huntr.com/bounties/362824d5-fe18-40e8-a6cf-62277f97a170","tags":[]},{"url":"https://github.com/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d122212fdc315be5","tags":[]}],"priority":{"score":13.1,"factors":[{"name":"EPSS percentile","points":8.15},{"name":"CVSS severity","points":4.97}]},"vendorSlug":"huggingface","affectedVersions":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[">= unspecified, < 5.10.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-08-03T14:57:31.978427Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"transformers","vulnerableRanges":["<5.10.0"],"patched":["5.10.0"],"from":["GHSA-xrqw-3rrv-vx5w","PYSEC-2026-3929"],"provenance":"source"}],"summary":{"text":"A path traversal flaw in huggingface/transformers versions up to and including 5.8.0.dev0 lies in the save_pretrained() methods of PreTrainedTokenizerBase and ProcessorMixin, which use chat_template dictionary keys directly as filenames without validation. An attacker who publishes a malicious Hugging Face Hub repository with a crafted tokenizer_config.json can, when a victim downloads and saves that tokenizer or processor over the network with user interaction, write arbitrary files with attacker-controlled content outside the intended save directory.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:44:37Z"},"euvd":{"id":"EUVD-2026-52005","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-1839","published":"2026-04-07","fixed":"5.0.0","kev":false},{"cve":"CVE-2026-4372","published":"2026-05-24","fixed":"5.3.0","kev":false},{"cve":"CVE-2026-5241","published":"2026-06-03","fixed":"5.5.0","kev":false,"link":{"from":"CVE-2026-5241","to":"CVE-2026-9856","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:transformers","fromFixed":"5.5.0","toFixed":"5.10.0","daysApart":60}]}},{"cve":"CVE-2026-9856","published":"2026-08-02","fixed":"5.10.0","kev":false}],"package":"PyPI:transformers"}}