/vuln-skills:vuln-patterns-ssrffrom vuln-skills
Audits Python code for SSRF vulnerabilities (CWE-918) in HTTP clients, webhooks, proxies, file downloads, and SVG/XML resource loading. Covers detection, sanitization, and DNS rebinding prevention.
Ships in vuln-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
当审计 Python 代码中涉及外部 URL 请求、HTTP 客户端调用、文件下载、资源代理等操作时加载此 Skill。
Sources(用户可控 URL 来源):
ImageUrl、AudioUrl、DocumentUrl)xlink:href、@import url()、<use href=>)Sinks(发起请求的函数/操作):
requests.get(url) / requests.post(url) / session.request(method, url)httpx.AsyncClient().get(url) / httpx.Client().stream("GET", url)urllib.request.urlopen(url) / urllib.request.Request(url)aiohttp.ClientSession().get(url)SimpleWebPageReader().load_data([url])(LlamaIndex 等 LLM 框架)url_fetcher)socket.create_connection() / 底层 TCP 连接Sanitization(URL 验证/限制):
http:// 和 https://,拒绝 file://、gopher://、ftp:// 等ipaddress 模块检查,推荐 ipaddress.ip_address(ip).is_private 或 is_reserved 或 is_loopback。需覆盖 RFC 1918 私有地址、环回地址、链路本地地址及 IPv6 对应段metadata.google.internal 等 DNS 名称socket.getaddrinfo() 解析再检查 IP,防止 DNS rebindingallow_redirects=False 手动跟踪validators.domain() 验证或 allowed_urls 配置检测路径:
搜索 SSRF sink 的 Grep 模式:
# HTTP 客户端调用
grep -rn "requests\.\(get\|post\|put\|delete\|head\)" --include="*.py"
grep -rn "httpx\.\|AsyncClient\|Client()" --include="*.py"
grep -rn "urlopen\|urllib\.request" --include="*.py"
grep -rn "aiohttp.*\.get\|ClientSession" --include="*.py"
# URL 验证函数
grep -rn "is_private\|is_reserved\|is_loopback\|gethostbyname" --include="*.py"
grep -rn "allow_redirects\|follow_redirects" --include="*.py"
# SVG/XML 外部资源
grep -rn "xlink\|url_fetcher\|external_resource" --include="*.py"
requests.get、httpx.get、urlopen、session.request 等)http/https 协议而未检查目标 IP?(如 is_http_url() 只检查 scheme)gethostbyname() 验证与实际 HTTP 请求之间是否存在时间窗口?follow_redirects=True/allow_redirects=True 而未验证重定向目标?xlink:href、CSS @import)?allowed_urls 默认值:URL 白名单的默认值是否过于宽松(如 .*)?::1、::ffff:127.0.0.1、IPv4-mapped IPv6)?以下情况通常不是 SSRF 漏洞:
requests.get("https://api.github.com/..."))unsafe=True 模式:如 CairoSVG 的 unsafe 参数,用户明确选择允许外部资源open(path) 读取本地文件不属于 SSRF(但可能是路径遍历)os.getenv() 获取的 URL 通常由运维人员配置What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
26 skills in this plugin
/go-vuln-auth-bypassUse when auditing Go code involving authentication flows, RBAC policies, Kubernetes admission webhooks, JWT/OAuth token validation, or privilege escalation in cloud-native infrastructure. Covers CWE-287/863/269/284/285/862. Keywords: authentication bypass, authorization bypass, RBAC, admission webhook, JWT, OAuth, privilege escalation, Rancher, Kyverno, impersonation, namespace isolation, middleware auth/go-vuln-crypto-tlsUse when auditing Go code involving TLS configuration, certificate validation, JWT token parsing, SAML assertion verification, webhook signature checking, or cryptographic operations. Covers CWE-295/347/345. Keywords: InsecureSkipVerify, TLS, mTLS, certificate validation, JWT algorithm, SAML signature, cosign, sigstore, hmac.Equal, X.509, webhook HMAC/go-vuln-dosUse when auditing Go code involving goroutine management, channel operations, HTTP request handling, resource allocation, or panic recovery. Covers CWE-400/770/476. Keywords: denial of service, goroutine leak, channel deadlock, panic recover, io.ReadAll, resource exhaustion, OOM, HTTP/2 abuse, protobuf, unbounded allocation, rate limiting/go-vuln-info-disclosureUse when auditing Go code involving logging, error handling, HTTP response data, Kubernetes Secret management, or credential storage. Covers CWE-200/532/522/312/552. Keywords: information disclosure, credential leak, log exposure, Kubernetes Secret, json tag, struct formatting, error message, stack trace, Rancher, Argo CD, sensitive data/go-vuln-injectionUse when auditing Go code involving OS command execution, SQL queries, template rendering, or child command invocation. Covers CWE-78/89/77/94/88. Keywords: command injection, SQL injection, exec.Command, os/exec, database/sql, text/template, html/template, argument injection, shell injection, Gogs, Grafana, MCP stdio/go-vuln-path-traversalUse when auditing Go code involving file path operations, archive extraction, symlink handling, container volume mounts, or HTTP file serving. Covers CWE-22/59. Keywords: path traversal, directory traversal, filepath.Join, symlink, archive extraction, zip slip, tar, volume mount, go-git, Helm chart, os.Open, filepath.Cleannpx claudepluginhub yhy0/ghsa-skill-builder --plugin vuln-skillsOther plugins' skills for the same job