transformers is vulnerable to Path Traversal
55
Medium Risk
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.
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).
transformers is vulnerable to Path Traversal in versions 4.52.0 - 5.13.1.
Upgrade the transformers library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant