ssrf-prevention

仓库创建 2026年7月1日最近提交 23 天前SkillHot 收录 22 天前
▸ 精选理由

适合在生成或审查远程请求代码时加入自动化防护。

这个 Skill 做什么

基于允许列表与解析验证的 SSRF 防御规则,阻止内网与元数据泄露。

提供一套防 SSRF 的实操规则:用允许列表校验每个要代理请求的域名、只解析一次并校验 IP、屏蔽云元数据和内网地址,防止 DNS rebinding。适用于服务器代表客户端抓取 URL、实现代理或文件抓取功能时。特别强调白名单胜过黑名单,解析到的地址必须验证源头。

▸ 展开 SKILL.md 英文原文

Defend against Server-Side Request Forgery: cloud metadata blocking, internal IP filtering, DNS rebinding defense, allowlist-based URL fetching

开发编程SSRF防护内网访问允许列表通用
2
Stars
0
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/ssrf-prevention/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/ssrf-prevention/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# SSRF Prevention

## Rules (for AI agents)

### ALWAYS
- Validate **every** URL fetched on behalf of a client through an **allowlist**
  of expected hosts. The allowlist is the only durable defense — block-lists
  are bypassable through encoding tricks, IPv6 dual-stack, and DNS rebinding.
- Resolve the hostname **once**, validate the resolved IP against your
  block-list of private / reserved / link-local ranges, then connect to that
  pinned IP using SNI. Otherwise an attacker can race a DNS rebind between
  validation and connect (`time-of-check / time-of-use`).
- Block at the network layer **and** at the application layer. Drop egress to
  `169.254.169.254`, `[fd00:ec2::254]`, `metadata.
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有