# CVE-2026-9856: Path Traversal in huggingface/transformers

- Severity: High 7.1 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.36%, higher than 31% of CVEs (2026-12-01)
- Published: 2026-08-02T15:10:53.809Z
- Modified: 2026-10-23T22:10:00.160Z
- Also known as: GHSA-xrqw-3rrv-vx5w, PYSEC-2026-3929
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: @huntr_ai

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

(As written by CVE List.)

## Affected

- huggingface huggingface/transformers: from unspecified before 5.10.0
- transformers (PyPI): before 5.10.0

## Every score

- @huntr_ai: CVSS:3.0 7.1 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L`
- GitHub: CVSS:3.0 7.1 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L`
- PyPA Advisory Database: CVSS:3.0 7.1 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L`

## References

- <https://huntr.com/bounties/362824d5-fe18-40e8-a6cf-62277f97a170> (web)
- <https://github.com/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d122212fdc315be5> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-9856> (advisory)
- <https://github.com/huggingface/transformers/pull/46191> (web)
- <https://github.com/huggingface/transformers> (package)
- <https://pypi.org/project/transformers> (package)
- <https://github.com/advisories/GHSA-xrqw-3rrv-vx5w> (advisory)

## Sources

- CVE List: [CVE-2026-9856](https://www.cve.org/CVERecord?id=CVE-2026-9856), CVE Terms of Use, modified 2026-08-03
- GitHub Advisory Database: [GHSA-xrqw-3rrv-vx5w](https://github.com/advisories/GHSA-xrqw-3rrv-vx5w), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-9856](https://nvd.nist.gov/vuln/detail/CVE-2026-9856), Public domain, modified 2026-10-23
- PyPA Advisory Database: [PYSEC-2026-3929](https://osv.dev/vulnerability/PYSEC-2026-3929), CC-BY-4.0, modified 2026-09-10

---

Page: https://cve.day/CVE-2026-9856 · Whole record: https://cve.day/CVE-2026-9856.json · Rebuilt by cve.day 2026-11-25T22:59:30.817Z
