huggingface-hub is vulnerable to Path Traversal
53
Medium Risk
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.
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.
huggingface-hub is vulnerable to Path Traversal in versions 0.14.0 - 1.30.0.
Upgrade the huggingface-hub 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
ISO 42001Compliant© All Intel data is openly available and commercially licensed.