{"id":"CVE-2026-9856","state":"PUBLISHED","title":"Path Traversal in huggingface/transformers","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.","publishedAt":"2026-08-02T15:10:53.809Z","updatedAt":"2026-08-03T14:57:43.370Z","severity":{"score":7.1,"label":"High","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","source":"@huntr_ai"},"assigner":"@huntr_ai","products":["huggingface huggingface/transformers"],"affected":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[{"version":"unspecified","status":"affected","lessThan":"5.10.0","versionType":"custom"}]}],"references":["https://huntr.com/bounties/362824d5-fe18-40e8-a6cf-62277f97a170","https://github.com/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d122212fdc315be5"],"weaknesses":["CWE-22"],"ingestedAt":"2026-10-29T20:13:52.441Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/9xxx/CVE-2026-9856.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-9856","state":"PUBLISHED","datePublished":"2026-08-02T15:10:53.809Z","dateUpdated":"2026-08-03T14:57:43.370Z","assignerShortName":"@huntr_ai","assignerOrgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateReserved":"2026-05-28T15:41:24.076Z"},"containers":{"cna":{"title":"Path Traversal in huggingface/transformers","descriptions":[{"lang":"en","value":"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":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[{"version":"unspecified","status":"affected","lessThan":"5.10.0","versionType":"custom"}]}],"references":[{"url":"https://huntr.com/bounties/362824d5-fe18-40e8-a6cf-62277f97a170"},{"url":"https://github.com/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d122212fdc315be5"}],"metrics":[{"cvssV3_0":{"version":"3.0","attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"LOW","confidentialityImpact":"NONE","integrityImpact":"HIGH","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","baseScore":7.1,"baseSeverity":"HIGH"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-22","type":"CWE","lang":"en","description":"CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')"}]}],"providerMetadata":{"shortName":"@huntr_ai","orgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateUpdated":"2026-08-02T15:10:53.809Z"},"source":{"advisory":"362824d5-fe18-40e8-a6cf-62277f97a170","discovery":"EXTERNAL"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-08-03T14:57:31.978427Z","id":"CVE-2026-9856","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-08-03T14:57:43.370Z"}}]}}}