{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-9856","id":"CVE-2026-9856","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 maliciou","descriptionLong":"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.","published":"2026-08-02T15:10:53.809Z","updated":"2026-11-05T03:31:34.738131916Z","reserved":"2026-05-28T15:41:24.076Z","status":"Awaiting Analysis","rejected":false,"assigner":"@huntr_ai","metric":{"version":"3.0","score":7.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","rating":"high","source":"@huntr_ai"},"metrics":[{"version":"3.0","score":7.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","rating":"high","source":"@huntr_ai"},{"version":"3.0","score":7.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","rating":"high","source":"huntr.dev"},{"version":"3.0","score":7.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","rating":"high","source":"OSV"},{"version":"3.0","score":7.1,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L","rating":"high","source":"GitHub"}],"rating":"high","products":["huggingface/transformers"],"affectedProducts":[{"vendor":"huggingface","product":"huggingface/transformers","defaultStatus":null,"versions":[{"version":"unspecified","lessThan":"5.10.0","status":"affected","versionType":"custom"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":["<5.10.0"],"fixed":["5.10.0"],"advisory":"GHSA-xrqw-3rrv-vx5w"}],"cwes":["CWE-22"],"aliases":["GHSA-xrqw-3rrv-vx5w","PYSEC-2026-3929"],"references":[{"url":"https://huntr.com/bounties/362824d5-fe18-40e8-a6cf-62277f97a170","tags":["web"]},{"url":"https://github.com/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d122212fdc315be5","tags":["fix","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/9xxx/CVE-2026-9856.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-9856","tags":["advisory"]},{"url":"https://github.com/huggingface/transformers/pull/46191","tags":["web"]},{"url":"https://github.com/huggingface/transformers","tags":["package"]},{"url":"https://pypi.org/project/transformers","tags":["package"]},{"url":"https://github.com/advisories/GHSA-xrqw-3rrv-vx5w","tags":["advisory"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.0046,"epssPercentile":0.40507,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-9856","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-9856","ok":true,"note":"Awaiting Analysis"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-9856","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-xrqw-3rrv-vx5w","ok":true,"note":"GHSA-xrqw-3rrv-vx5w"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-9856","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}