Skip to content

Security: mrhegit/hubdl

Security

SECURITY.md

Security Policy

English | 简体中文

English

Supported versions

Version Supported
0.1.x Yes (alpha)

Tokens

  • Prefer environment variables (HF_TOKEN, MODELSCOPE_API_TOKEN) over CLI flags in shared shells.
  • Do not commit or tarball .hubdl/ (it may briefly contain Authorization headers in aria2_urls.txt; hubdl clears that file after download).

Endpoints / mirrors

  • HTTP hosts are pinned to the configured --endpoint / environment endpoint. Cross-host redirects are blocked to reduce token leakage.
  • Treat third-party mirrors as fully trusted parties (they can still observe your token on the first request).

Destructive deletes

  • Default fix_bad may delete files that are size-overflow or hash-mismatched inside --local-dir only.
  • Use --no-fix-bad, --dry-run, or --verify-only to avoid deletes.
  • Paths into .hubdl / .hfdx / .msd / .git are rejected by the sandbox.

Reporting a vulnerability

Please open a private security report (or contact maintainers out-of-band) if you find:

  • Path sandbox escape (write/delete outside --local-dir)
  • Token leakage beyond intentional Hub/mirror requests
  • Authentication bypass or lock bypass on multi-tenant hosts

Do not file public issues with exploit details until a fix is available.


简体中文

支持版本

版本 是否支持
0.1.x 是(alpha)

令牌

  • 共享 shell 中优先使用环境变量(HF_TOKENMODELSCOPE_API_TOKEN),避免把 token 写进命令历史。
  • 不要提交或打包 .hubdl/aria2_urls.txt 可能短暂含 Authorization;下载结束后会清空)。

端点 / 镜像

  • HTTP 请求 host 钉死在配置的 --endpoint / 环境变量端点;跨域 redirect 会被拒绝,以降低 token 被拐走的风险。
  • 第三方镜像应视为完全受信方(首跳仍可能看到你的 token)。

代理

  • 仅支持 HTTP(S) 正向代理;SOCKS 在解析期拒绝(避免「半通」误导)。
  • 下载子进程剥离父进程代理环境变量,并以 CLI/env 显式设定;--proxy nonehttps_proxy=none 均为强制直连。
  • 代理 URL 中的用户名/密码会进入 aria2/wget 子进程参数或环境;stdout 已脱敏,但同机 ps/environ 仍可能可见——优先本机无认证 HTTP 端口。
  • last_run.json 仅记录 proxy scheme(http / https / none),不含凭据。
  • 代理服务器与镜像一样视为受信出网路径

破坏性删除

  • 默认 fix_bad 可能删除 --local-dir size 溢出或 hash 不匹配的文件。
  • 不确定时请使用 --no-fix-bad--dry-run--verify-only
  • 指向 .hubdl / .hfdx / .msd / .git 的路径会被沙箱拒绝。

漏洞报告

若发现以下问题,请使用非公开渠道报告:

  • 路径沙箱逃逸(写到/删到 --local-dir 之外)
  • 超出「向 Hub/镜像正常请求」范围的 token 泄露
  • 多租户环境下的鉴权/目录锁绕过

在修复发布前,请勿在公开 Issue 中贴完整利用细节。

There aren't any published security advisories