Intel

AIKIDO-2026-262955

transformers is vulnerable to Path Traversal

Path TraversalCVE-2026-9856 Published 3 days ago

71

High Risk

This Affects:

PYTHONtransformers
4.52.0 - 5.9.0
Fixed in 5.10.1
Are you affected? Scan for Free

TL;DR

The save_pretrained methods of the base tokenizer and processor classes use dictionary keys from chat-template data as output filenames without validation. A model repository can supply crafted keys containing path traversal sequences in tokenizer_config.json. Saving a tokenizer or processor loaded from such a repository then writes attacker-controlled files outside the intended directory. The fix validates and sanitizes the keys before using them as filenames.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you save tokenizers or processors loaded from untrusted model repositories.

Background info

transformers is vulnerable to Path Traversal in versions 4.52.0 - 5.9.0.

How to fix this

Upgrade the transformers library to the patch version.