Intel

AIKIDO-2026-614493

transformers is vulnerable to Path Traversal

Path Traversal Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 5 days ago

55

Medium Risk

This Affects:

pythontransformers
4.52.0 - 5.13.1
Fixed in 5.14.0
Are you affected? Scan for Free

TL;DR

Affected versions of transformers are vulnerable to path traversal when loading a local model with from_pretrained. An untrusted transformers_weights value in config.json was joined onto the model directory after only a suffix check, with no containment validation. A crafted local model can therefore make the loader open a .safetensors file outside the model directory without trust_remote_code, enabling out-of-directory weight reads and path existence checks.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you load models from untrusted or attacker-controlled local directories (for example multi-tenant model hosting).

Background info

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

How to fix this

Upgrade the transformers library to the patch version.