huggingface-hub is vulnerable to Path Traversal
83
CVE Score
High
Path Traversal
get_local_download_paths() and get_local_upload_paths() in _local_folder.py map Hub filenames into a caller-supplied local_dir after only a Windows-only ..\ string check, with no rejection of absolute, drive-relative, root-relative, or UNC names. On Windows, joining an anchored filename discards the destination root, so a malicious repository can write outside the intended directory or trigger an SMB connection that leaks a NetNTLMv2 hash. Separately, Sandbox.create injects the caller's HF token as SBX_DL_TOKEN into the job environment to download sbx-server, even when forward_hf_token=False, so a hostile sandbox image can read the credential before the bootstrap unsets it. The fix validates filenames with a shared _validate_relative_filename() helper on all platforms and downloads sbx-server anonymously so no HF token enters the job unless the caller opts in with forward_hf_token=True.
Upgrade the huggingface-hub library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you download or upload with local_dir / --local-dir against untrusted Hub repositories, or you create sandboxes via Sandbox.create / SandboxPool without explicitly intending to forward the HF token.
0.23.0 - 1.25.1
Fixed in 1.26.0huggingface-hub is vulnerable to Path Traversal in versions 0.23.0 - 1.25.1.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
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.