PYSEC-2026-3929
Transformers save_pretrained path traversal allows arbitrary file writes through chat template names
Published Sep 10, 2026 · Source: OSV.dev. Data collected Sat, 28 Nov 2026 19:06:22 GMT.
The facts
| Advisory id | PYSEC-2026-3929 |
|---|---|
| CVE | CVE-2026-9856 |
| Package | transformers PyPI: transformers |
| Published | Sep 10, 2026 |
| Source severity | Unrated in the record we received |
| Our severity | low · 32 Advisory severity: unrated · Published 80 days ago · Confidence: GitHub Advisory Database / OSV · See the rules |
| Fix | Fixed in 5.10.0 |
| Source | OSV.dev |
Excerpt from the source
Copied from the official record, trimmed. Read the full source before acting.
A vulnerability in huggingface/transformers versions < 5.10.0 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
What to do
Upgrade transformers to 5.10.0 or later wherever it appears in your lockfiles or images; until then, restrict exposure of the affected feature. Log the assessment as vulnerability-management evidence.
Other recent advisories for this package
- GHSA-x9r9-c232-4q39 · Sep 1, 2026 · Hugging Face Transformers downloads custom generation code before trust consent
This page restates a public advisory. Confirm the facts on the linked source before you act. BigBadAI is independent and not affiliated with the package authors. Data collected .