ssrf-analysis
Skill18 starsChanged 3 months agoMITView on GitHub
Analyze and validate server-side request forgery in application code — use when reviewing outbound HTTP/fetch sinks, user-controlled URLs, webhook callbacks, previewers, or cloud metadata exposure (CWE-918 / A10:2021).
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-agent-securitySkill
- ai-application-securitySkill
- api-securitySkill
- attack-surface-mappingSkill
- authentication-analysisSkill
- authorization-analysisSkill
- axguard-auditSkill
- axguard-csoSkill
- axguard-knowledgeSkill
- axguard-preshipSkill
- axguard-remediateSkill
- axguard-reportSkill
- axguard-securitySkill
- axguard-triageSkill
- cloud-securitySkill
- command-injectionSkill
- configuration-securitySkill
- deserialization-securitySkill
- file-upload-securitySkill
- graphql-securitySkill
- jwt-securitySkill
- mcp-securitySkill
- oauth-securitySkill
- path-traversalSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- secrets-detectionSkill
- security-architecture-reviewSkill
- security-remediationSkill
- security-triageSkill
- session-securitySkill
- sql-injectionSkill
- ssti-analysisSkill
- supply-chain-securitySkill
- threat-modelingSkill
- websocket-securitySkill
- xss-analysisSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
After axguard scan|audit hits ssrf.* or cloud.*metadata*.
- Distinctive: line 55
Read cloud credentials via metadata services.
- Distinctive: line 63
Prefer static analysis + safe local validation.
- Very specific: line 73
Prefer axguard flow evidence when available (dataflow.json / unsanitized net paths).
- Distinctive: line 103
Document whether response is observable.
- Distinctive: line 105
Do not brute-force third-party hosts.
- Distinctive: line 123
Test fixtures intentionally vulnerable (unless scanning fixtures)
- Distinctive: line 134
Do not invent CVSS vectors.
- Very specific: line 141
Use cloud metadata IMDSv2 / hop limits.
- Distinctive: line 142
Never return raw third-party response bodies to clients unless required and sanitized.
- Distinctive: line 150
Add regression tests: attempts to pass metadata IP / localhost must fail closed.
- Very specific: line 154
Use AXguard report fields: location, evidence snippet, why it matters, fix, confidence.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SSRF Analysis
Purpose
Teach the agent to reason about Server-Side Request Forgery (SSRF): when attacker-influenced input reaches a server-side network client and the server fetches a destination the attacker can affect.
When to Use
- Code review of
requests,fetch,httpx,urllib,axios, webhook/callback URLs, link previewers, PDF/HTML renderers, importers. - After
axguard scan|audithitsssrf.*orcloud.*metadata*. - Cloud apps that might reach instance metadata (
169.254.169.254).
When Not to Use
- Pure client-side browser
fetchto same-origin APIs (not SSRF). - Outbound calls with fully hard-coded, non-user-influenced destinations and no redirect following of user input.
Security Concepts
SSRF is an egress trust failure: the server becomes a proxy into networks the attacker cannot reach directly (localhost, RFC1918, link-local, cloud metadata, internal admin).
Threat Model
Attacker goals:
- Read cloud credentials via metadata services.
- Port-scan or hit internal admin panels.
- Bypass network controls using the app as pivot.
- Chain into RCE via internal-only endpoints.
Preconditions
- Target is software the user owns or is authorized to test.
- Prefer static analysis + safe local validation; do not attack third-party infrastructure.
Inputs
- Source tree / PR diff
- Optional:
axguard auditJSON report - Known deployment context (cloud provider, VPC, IMDSv1 vs v2)
Discovery
- Prefer
axguard flowevidence when available (dataflow.json/ unsanitized net paths); otherwise runaxguard scan .oraxguard audit .and collectssrf.*/ metadata findings. - Grep for network clients:
requests.,httpx.,urllib,fetch(,axios.,curl,HttpClient,RestTemplate. - Find URL construction: query params, body fields, webhooks,
next=,url=,callback=,redirect=.
Analysis Workflow
Trace source → transform → sink:
- Where does the URL/host enter (param, JSON, header, DB)?
- Is it concatenated, parsed, normalized?
- Is there an allowlist of schemes/hosts? Or only a denylist?
- Is validation on hostname before or after DNS resolution?
- Are redirects followed? To what depth?
- Can the destination be
localhost,127.0.0.1,0.0.0.0, IPv6 loopback, RFC1918, link-local, metadata IP? - Is response body/status returned to the attacker (full SSRF) or only timing/errors (blind)?
- In cloud: can it reach metadata? Is IMDSv2 required (more resistant)?
Data Flow
attacker input → URL builder → HTTP client → internal/metadata network → response handlingValidation
Authorized defensive checks only:
- Confirm code path is reachable in normal request handling.
- Confirm user influence on host/scheme/path.
- Confirm missing or weak allowlist.
- Document whether response is observable.
Do not brute-force third-party hosts.
Evidence Requirements
Hypothesis becomes HIGH/CONFIRMED only with:
- File:line of sink
- Source of attacker influence
- Missing control (no allowlist / redirect follow / DNS rebinding gap)
- Impact hypothesis tied to environment (e.g., metadata readable)
False Positive Controls
Drop or downgrade when:
- URL is enum/constant from server config only
- Strict allowlist of https + exact hosts, no redirects
- Client-side only request
- Test fixtures intentionally vulnerable (unless scanning fixtures)
Severity Assessment
| Condition | Typical severity |
| Metadata credential theft plausible | Critical/High |
| Internal admin reachable + response returned | High |
| Blind internal probe only | Medium |
| Hardened allowlist, theoretical only | Low/Info |
Do not invent CVSS vectors.
Remediation
- Allowlist schemes (
https) and hosts; reject IP literals unless required. - Resolve DNS and re-validate resolved addresses (block private/link-local/metadata ranges).
- Disable or strictly limit redirects.
- Use cloud metadata IMDSv2 / hop limits; block
169.254.169.254at egress. - Never return raw third-party response bodies to clients unless required and sanitized.
Verification
Detect → Fix allowlist/egress → Re-run axguard → Manually re-trace source→sink → Confirm blocked destinationsAdd regression tests: attempts to pass metadata IP / localhost must fail closed.
Reporting
Use AXguard report fields: location, evidence snippet, why it matters, fix, confidence.
Related Skills
cloud-security— metadata & egress policyapi-security— webhook/callback designssecrets-detection— stolen cloud keys impactsecurity-triage— confidence gatingsecurity-remediation— patch patterns
Framework Mapping
- CWE-918
- OWASP Top 10 2021 A10:2021 SSRF
References
- https://owasp.org/Top10/A10_2021-Server-Side_Request_Forgery_%28SSRF%29/
- https://cwe.mitre.org/data/definitions/918.html
Research Provenance
Primary sources:
- OWASP Top 10:2021 A10 (accessed 2026-09-15)
- CWE-918 (accessed 2026-09-15)
Secondary / internal:
- AXGuard
rules/ssrf.json,rules/cloud.json - AwareXone Agentic-Bug-Hunter web SSRF methodology (concepts only; not copied)
Datasets:
- UVID HF dataset — category linkage concepts only (MIT license metadata review 2026-09-15)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

