Sc ssrf

From ersinkoc/security-check · View interactive version

Sc ssrf is an AI agent skill from the GitHub repository ersinkoc/security-check. Server-Side Request Forgery detection — URL fetching with user input, DNS rebinding, cloud metadata access

How to use this skill

Skill file

SC: Server-Side Request Forgery (SSRF)

Purpose

Detects SSRF vulnerabilities where user-controlled input influences server-side HTTP requests, enabling attackers to access internal services, cloud metadata endpoints, and private network resources. Covers direct SSRF, blind SSRF, DNS rebinding, and partial SSRF through header injection.

Activation

Called by sc-orchestrator during Phase 2. Runs against all web applications and APIs.

Phase 1: Discovery

Keyword Patterns to Search

"requests.get(", "requests.post(", "urllib.request.urlopen(",
"http.Get(", "http.Post(", "http.NewRequest(",
"fetch(", "axios.get(", "axios.post(", "got(",
"curl_exec(", "file_get_contents(", "fopen(",
"HttpClient", "WebClient", "HttpWebRequest",
"RestTemplate", "WebClient.create(", "OkHttpClient"

Data Flow: User Input → HTTP Request URL

# VULNERABLE
url = request.GET['url']
response = requests.get(url)  # User controls entire URL

# VULNERABLE: Partial SSRF
host = request.GET['host']
response = requests.get(f"https://{host}/api/data")  # User controls host

# SAFE: URL allowlist
ALLOWED_HOSTS = ['api.example.com', 'cdn.example.com']
parsed = urlparse(request.GET['url'])
if parsed.hostname not in ALLOWED_HOSTS:
    return HttpResponseForbidden()
response = requests.get(request.GET['url'])

Cloud Metadata Endpoints

Flag any request that could reach:

IP Bypass Techniques to Check

When blocklists are used, verify they catch:

Severity Classification

Output Format

Finding: SSRF-{NNN}

Common False Positives

  1. Hardcoded URLs — HTTP requests to constant/configured URLs
  2. Webhook delivery — outbound webhooks with pre-registered URLs (by admin)
  3. CDN/proxy integration — fetching from known CDN endpoints
  4. Internal microservice calls — service-to-service with configured base URLs
  5. URL validation in place — allowlist or scheme+host validation before request
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.