hn News score 17

Show HN: Safe-fetch – a Python URL fetcher with per-redirect address checks

AI Digest

SSRF防护Python工具地址检查协议过滤DNS验证

Safe-fetch 是 Python 的 URL 获取工具,通过检查每个重定向地址防止 SSRF 漏洞,使用标准库无依赖,适合处理用户输入的 URL 场景。

Safe-fetch is a Python URL fetcher preventing SSRF by checking each redirect. Uses standard library only, no dependencies, ideal for user-supplied URLs.

Key points

  • 强制检查每个重定向地址的 IP 类型,阻止私有/保留地址 Checks all redirect IPs to block private/reserved ranges
  • 限制协议为 HTTP/HTTPS,过滤 file:// 等危险协议 Limits protocols to HTTP/HTTPS, filters dangerous schemes
  • 自动验证 DNS 解析结果,防御 DNS 重绑定攻击 Validates DNS resolution results against internal IPs
  • 无外部依赖,仅需标准库,可直接集成到项目 No external dependencies, uses standard library only
  • 响应体截断防止大流量攻击 Truncates response body to prevent large data attacks

Takeaway: 提供简单有效方案,帮助开发者防范 SSRF 漏洞,适合安全敏感项目 / Offers a simple solution to prevent SSRF vulnerabilities for security-sensitive applications

Why it matters 提供简单有效方案,帮助开发者防范 SSRF 漏洞,适合安全敏感项目

View original ↗ Back to hot list

This page is an aggregated digest from hn; content and hot-score data come from public sources. Copyright belongs to the original authors. We link to originals with nofollow and never republish full text.