BigBadAI

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 idPYSEC-2026-3929
CVECVE-2026-9856
Package
transformers PyPI: transformers
PublishedSep 10, 2026
Source severityUnrated in the record we received
Our severitylow · 32 Advisory severity: unrated · Published 80 days ago · Confidence: GitHub Advisory Database / OSV · See the rules
FixFixed in 5.10.0
SourceOSV.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

Open the full source →

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

All advisories →

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 .