Intel

AIKIDO-2026-117747

huggingface-hub is vulnerable to Path Traversal

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

53

Medium Risk

This Affects:

PYTHONhuggingface-hub
0.14.0 - 1.30.0
Fixed in 1.31.0
Are you affected? Scan for Free

TL;DR

HfFileSystem.get() writes files to local paths derived from server side filenames during recursive downloads without validating them. A remote filename such as folder/..\..\outside.txt escapes the destination directory on Windows and writes outside it. The same _validate_relative_filename check already guarded hf_hub_download, snapshot_download, and bucket sync, but HfFileSystem.get() skipped it. The fix validates the resolved relative filename and rejects unsafe paths before any local filesystem access.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you use HfFileSystem.get() on Windows to download files whose server side names are externally controlled.

Background info

huggingface-hub is vulnerable to Path Traversal in versions 0.14.0 - 1.30.0.

How to fix this

Upgrade the huggingface-hub library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform