Server-Side Request Forgery (SSRF): Using Your Server as the Attacker's Proxy
How SSRF reaches internal services and cloud metadata endpoints, why it is a common path from a web bug to cloud credentials, and the controls that contain it.
What Is Server-Side Request Forgery (SSRF)
The danger comes from where the server sits. It can usually reach networks the attacker cannot: internal admin panels, databases with HTTP interfaces, service meshes, and cloud instance metadata services. SSRF turns that network position into the attacker's.
How SSRF Works
Any feature that fetches a URL on the user's behalf is a candidate: link previews, webhooks, PDF and image generators, file import from URL, SSO metadata fetchers, and server-side rendering. A vulnerable request looks like this:
POST /api/import
{"source_url": "http://169.254.169.254/latest/meta-data/iam/security-credentials/"}If the server fetches that address and returns the body, the attacker reads data from the cloud instance metadata service, which on AWS includes temporary credentials for the instance's IAM role.
Full-response vs blind SSRF
In full-response SSRF the fetched content is returned to the attacker. In blind SSRF it is not, so testers confirm the request through out-of-band interaction (a DNS lookup or HTTP request to a tester-controlled host) or through timing and error differences when probing internal hosts and ports.
What SSRF Is Used to Reach
- Cloud metadata services:
169.254.169.254on AWS, Azure and GCP (Google also usesmetadata.google.internal), which can expose credentials, tokens and instance configuration. - Internal services: admin interfaces, monitoring dashboards, Redis or Elasticsearch HTTP APIs, Kubernetes and Docker APIs bound to internal addresses.
- Localhost-only endpoints: debug and management ports trusted because they only listen on
127.0.0.1. - Port scanning: mapping the internal network from the server's position.
- Other protocols: some URL libraries accept schemes such as
file://orgopher://, which can read local files or speak to non-HTTP services.
The 2019 Capital One breach is the most cited real case: an SSRF-style request through a misconfigured web application firewall retrieved AWS role credentials from the metadata service, which were then used to read data from S3. The incident is a large part of why AWS introduced IMDSv2.
Why Naive Filters Fail
Blocklisting 169.254.169.254 or localhost as strings is routinely bypassed:
- Alternate IP encodings: decimal (
2852039166), octal, hexadecimal, or IPv6-mapped addresses. - DNS names that resolve to internal addresses, including DNS rebinding, where the name resolves to a public IP during validation and an internal IP at fetch time.
- Open redirects on allowed domains that bounce the server to an internal target.
- URL parser differences, where the validator and the HTTP client disagree on which host a URL points to.
How Penetration Testers Confirm SSRF
- Find every parameter, header and file format that causes a server-side fetch, including XML external entities, SVG and PDF renderers.
- Point it at a tester-controlled host and confirm an inbound request originating from the target's infrastructure.
- Test reachability of internal ranges and metadata endpoints with low-impact, read-only requests.
- Test filter bypasses: encodings, redirects, DNS tricks, alternate schemes.
- Demonstrate impact without misuse: show that metadata or an internal service is reachable, and stop short of using any credentials obtained beyond what the rules of engagement allow.
Prevention
| Control | Notes |
|---|---|
| Allowlist destinations | Only fetch from an explicit list of hosts and schemes; validate after DNS resolution and re-validate on every redirect, or disable redirects. |
| Network egress controls | Run fetchers in a segment that cannot reach internal ranges or metadata endpoints. |
| IMDSv2 on AWS | Requires a session token obtained with a PUT request and a custom header, which defeats most simple GET-based SSRF against metadata. Set the hop limit to 1 where containers are not involved. |
| Disable unused URL schemes | Restrict HTTP clients to http and https. |
| Do not return raw responses | Reduces full-response SSRF to blind SSRF, which limits data exposure. |
Standards Mapping
| Framework | Reference |
|---|---|
| CWE | CWE-918: Server-Side Request Forgery (SSRF) |
| OWASP Top 10 (2025) | Rolled into A01:2025 Broken Access Control (was a standalone category, A10:2021) |
| OWASP API Security Top 10 | API7:2023 Server Side Request Forgery |
| MITRE ATT&CK | T1552.005 Unsecured Credentials: Cloud Instance Metadata API |
How FireCompass Tests for SSRF
FireCompass AI agents identify server-side fetch features in web applications and APIs, confirm outbound requests with out-of-band callbacks, and test internal reachability with non-destructive requests inside the agreed scope. Findings show the exact request and the evidence of reachability. See AI API penetration testing.
Sources and Standards
- MITRE CWE-918: Server-Side Request Forgery (SSRF)
- OWASP Top 10:2025 Introduction (SSRF rolled into A01)
- OWASP API Security Top 10 2023: API7 Server Side Request Forgery
- OWASP Server-Side Request Forgery Prevention Cheat Sheet
- AWS: Use the Instance Metadata Service (IMDSv2)
- MITRE ATT&CK T1552.005: Cloud Instance Metadata API
Frequently Asked Questions
Is SSRF still in the OWASP Top 10?
In the OWASP Top 10:2025, SSRF is no longer a standalone category. It was rolled into A01:2025 Broken Access Control. It remains API7:2023 in the OWASP API Security Top 10.
What is blind SSRF?
Blind SSRF is when the server makes the attacker-controlled request but does not return the response. It is confirmed through out-of-band callbacks or timing differences.
Does IMDSv2 stop SSRF?
IMDSv2 blocks most SSRF attacks against the AWS metadata service because it requires a PUT request with a custom header to obtain a token. It does not fix SSRF against other internal services.
Which CWE covers SSRF?
CWE-918, Server-Side Request Forgery (SSRF).
Why is SSRF high severity in cloud environments?
Cloud metadata endpoints are reachable from the instance and can return temporary credentials, so one SSRF can lead directly to access to cloud storage, databases or other services.
Further Reading
- FireCompass AI API penetration testing
- API Penetration Testing in 2026: Why Scanners Miss What Attackers Exploit
- Old Web Bugs, New Blast Radius: What Vegas 2026 Means for API Testing
Related Terms
Check Whether Your Servers Can Be Turned Against You
Run a free AI pentest against your web app and API surface and get confirmed SSRF findings with out-of-band evidence.
Free AI Pen TestNo credit card. Findings include reproducible steps and exploit code.
