Intel

AIKIDO-2026-587816

huggingface-hub is vulnerable to Path Traversal

CVE-2026-15717Published Jul 31, 2026
July 31, 2026

83

CVE Score

High

Path Traversal

Are you affected? Scan for Free

TL;DR

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.

How do I fix this?

Upgrade the huggingface-hub library to the patch version.

Who does this affect?

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.

Versions

0.23.0 - 1.25.1

Fixed in 1.26.0

Background info

huggingface-hub is vulnerable to Path Traversal in versions 0.23.0 - 1.25.1.

Get secure today,
quickly and for free.

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.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea