/viperclaw:viper-ssrf-cloudfrom viperclaw
Audits codebases for SSRF vulnerabilities and cloud egress misconfigurations. Reviews URL-fetching logic, webhook dispatchers, and IMDSv2 protections against OWASP A10 and CWE-918.
Ships in viperclaw. 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.
None: SKILL.md is the whole skill.
viper-ssrf-cloud)viper_taint_scan, viper_oob_probe, viper_verify_and_reportviperclaw taint ./src --db .viperclaw/graph.dbflowchart LR
UserURL["User URL (Webhook / Avatar / Import)"] --> Resolver["DNS Resolver & IP CIDR Guard"] --> Client["Egress HTTP Client (No Redirects)"] --> IMDS["Blocked: 169.254.169.254 / RFC1918"]
Applications validate a user-supplied URL using naive string checks (url.startswith('https://')) without resolving DNS, pinning the resolved IP against DNS rebinding, blocking RFC 1918 / link-local (169.254.169.254) ranges, or re-validating HTTP 301/302 redirect hops.
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint ./src --db .viperclaw/graph.db
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(requests\.(get|post|request)|httpx\.(get|post|AsyncClient)|urllib\.request\.urlopen|fetch\(|axios\.)"
rg -n "(puppeteer|playwright|wkhtmltopdf|weasyprint|headless)"
rg -n "follow_redirects\s*=\s*True|allow_redirects\s*=\s*True"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
SSRF-01 | Strict Scheme & Port Allowlisting | Only https:// on port 443 (or http:// on 80 if explicitly required) permitted. | Protocols like file://, gopher://, dict://, ftp://, or arbitrary internal ports (6379, 2379, 8080) allowed. |
SSRF-02 | Post-DNS Private & Link-Local IP Block | Resolved IPv4/IPv6 addresses checked via ipaddress.ip_address(ip).is_global (blocking 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, ::1, fc00::/7). | String-only blacklist ('localhost' not in url) circumvented via alternate forms like 127.1, [::ffff:127.0.0.1], octal/hex IPs, or nip.io. |
SSRF-03 | DNS Rebinding Prevention (Socket IP Pinning) | The HTTP connection dials the exact IP address validated during the DNS check, not a second DNS lookup. | Time-of-Check to Time-of-Use (TOCTOU) gap between socket.getaddrinfo() check and requests.get(url) second lookup. |
SSRF-04 | Redirect Hop Re-Validation | allow_redirects=False enforced, or every 3xx Location target re-runs full DNS/IP validation. | Open redirect on an allowed external host redirects the server's HTTP client to http://169.254.169.254/. |
SSRF-05 | Headless Browser / PDF Generator Isolation | HTML-to-PDF engines (wkhtmltopdf, WeasyPrint, Chromium) block local file:// and internal network requests. | User HTML containing <iframe src="http://169.254.169.254/latest/meta-data/"> rendered into PDF. |
SSRF-06 | Cloud IMDSv2 Enforcement | AWS EC2/EKS enforces HttpTokens=required (IMDSv2) and HttpPutResponseHopLimit=1. | Legacy IMDSv1 (GET http://169.254.169.254/latest/meta-data/iam/security-credentials/) enabled. |
SSRF-07 | Dedicated Egress Proxy / NetworkPolicy | Outbound user-URL fetches routed through a dedicated egress proxy in a DMZ subnet with zero internal VPC routes. | Application pod in the main production VPC directly fetches arbitrary user URLs. |
SSRF-08 | Response Body & Media-Type Caps | Responses capped by byte size (max_bytes) and validated for expected Content-Type before returning. | Raw internal HTTP responses reflected back to the user (Full-Read SSRF). |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.6) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N | Full-read SSRF extracting cloud IAM credentials (169.254.169.254) or internal Kubernetes secrets. |
| HIGH (8.6) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N | Authenticated/Unauthenticated SSRF reading internal microservice APIs or Redis/Elasticsearch data. |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N | Blind SSRF limited to port-scanning timing side channels without response reflection. |
# ❌ VULNERABLE: String prefix check only; follows redirects & allows 169.254.169.254 / nip.io
def fetch_webhook_preview(user_url: str) -> str:
if not user_url.startswith("https://") and not user_url.startswith("http://"):
raise ValueError("Invalid URL")
return requests.get(user_url, timeout=5, allow_redirects=True).text
# ✅ HARDENED: Validates scheme/port, resolves DNS, rejects non-global IPs & disables redirects
import ipaddress, socket, urllib.parse
def validate_public_url(raw_url: str) -> str:
parsed = urllib.parse.urlsplit(raw_url)
if parsed.scheme not in {"https"} or parsed.port not in {None, 443} or not parsed.hostname:
raise ValueError("Only standard HTTPS (port 443) URLs are allowed")
for _, _, _, _, sockaddr in socket.getaddrinfo(parsed.hostname, 443, proto=socket.IPPROTO_TCP):
ip_obj = ipaddress.ip_address(sockaddr[0])
if not ip_obj.is_global or ip_obj.is_multicast or ip_obj.is_private or ip_obj.is_loopback or ip_obj.is_link_local:
raise PermissionError(f"Blocked non-public destination IP: {ip_obj}")
return raw_url
viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas./viper-auth-oauth-jwtAuthentication, OAuth 2.0 / OIDC & JWT Security Auditor. Reviews token verification, algorithm allowlisting, claim validation, and OAuth redirect_uri configurations./viper-aws-iam-cloud-auditAWS IAM, STS, S3, KMS & Lambda Security Auditor (modeled on Prowler, Parliament & CloudSplaining). Reviews iam:PassRole escalation, STS ExternalId, S3 policies, and IMDSv2./viper-bola-idorObject & Function-Level Authorization (BOLA / BFLA) Audit Skill. Reviews resource access controls, tenant scoping, and ownership checks across API endpoints and controllers.Other plugins' skills for the same job