Login
ChallengesLearn
Scoreboard
Teams
Profile

Preferences

Truesapiens

LearnSsrfSSRF: The Server Makes the Request
Ssrf·Lesson 1 of 8

SSRF: The Server Makes the Request

The app fetches a URL the attacker controls. Now the server issues GET requests on behalf of the attacker — to internal IPs, cloud metadata, and services that trust localhost.

Beginner12 min
SSRFOWASPWeb
Loading lesson…
NextFinding SSRF in the Wild

© 2026 Truesapiens.

Terms of ServicePrivacy PolicyCookie Policy

Server-Side Request Forgery (SSRF) is a class of vulnerability where an attacker tricks the server into making requests to unintended destinations. Instead of attacking the server directly, the attacker uses the server as a proxy to reach internal systems, cloud metadata endpoints, or other services the server can access but the attacker cannot.

What you'll be able to do
  • Define SSRF and explain how the server becomes the attacker's proxy.
  • Identify the difference between blind and out-of-band SSRF.
  • Recognise common SSRF targets — localhost, private IPs, cloud metadata.
  • Describe the Capital One 2019 breach as a canonical SSRF case study.
Key terms
SSRF (Server-Side Request Forgery)
A vulnerability where the server makes HTTP requests to a destination controlled by the attacker, bypassing network boundaries the attacker cannot cross directly (CWE-918).
Blind SSRF
An SSRF where the server makes the request but does not reflect the response back to the attacker. Detection relies on out-of-band signals like DNS lookups or timing.
Cloud metadata service
An HTTP endpoint at 169.254.169.254 (AWS, GCP, Azure) that returns instance metadata including IAM role credentials when queried from within the cloud environment.
What is it?

The server as proxy

SSRF occurs when an application fetches a URL based on user input. Common features that do this include URL preview tools, webhook callbacks, file importers, PDF generators, and proxy endpoints. The server receives a URL from the user, then makes an HTTP request to that URL. If the server does not validate the destination, the attacker can point it at any reachable host — including services bound to localhost, internal RFC 1918 addresses, and cloud metadata endpoints.

The key insight is network topology. The server sits inside a network perimeter with access to resources the attacker cannot reach directly. A database on port 5432, a Redis cache on 6379, a Kubernetes API on 6443 — all are invisible to the public internet but reachable from the server. SSRF turns the server into a bridge between the public internet and the internal network.

SSRF can be blind — the server makes the request but the response is never returned to the attacker — or out-of-band, where the attacker can read the response. Blind SSRF is harder to exploit but still dangerous: even a single DNS lookup to a known host can exfiltrate data through the hostname itself.

Data flow in an SSRF attack
Mini Map
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
Try it

URL preview tool

The panel below simulates a URL preview feature similar to what messaging apps and social networks use to generate link previews. Enter a URL and the server fetches it. Try http://169.254.169.254/latest/meta-data/ to see how an attacker can reach the cloud metadata service. Toggle safe mode to see how blocking private IP ranges stops the attack.

prod/fetch
url-fetcher
url-fetcher · link preview

URL Preview Tool

Enter a URL to fetch its content server-side.

Server response
Enter a URL and press Fetch to see the server response.
Access log

No requests yet.

Real-world relevance

Capital One 2019 — 100 million records through SSRF

In March 2019, a former Amazon employee discovered an SSRF vulnerability in a Capital One Web Application Firewall (WAF) configuration. The WAF sat in front of Capital One's AWS-hosted applications but passed through requests to the AWS metadata endpoint at 169.254.169.254. By sending a crafted request with a modified Host header that pointed to the metadata service, the attacker retrieved the IAM role credentials assigned to the WAF's compute instance.

With those credentials, the attacker listed S3 buckets, downloaded over 100 million credit card applications, and exfiltrated 140 GB of data that included Social Security numbers, bank account numbers, and dates of birth. The breach was detected by a third party who noticed the unusual data transfer. Capital One was fined $80 million by the OCC and $190 million in class-action settlements. The root cause was a single SSRF — no authentication bypass, no SQL injection, just a server that fetched a URL it should not have.

Mitigation

Defence for server-side fetches

The primary defence is an allowlist of permitted destinations. If the application needs to fetch URLs, restrict the set of allowed hostnames and IP ranges. Block private IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and the cloud metadata IP (169.254.169.254/32) at the network level or in the URL validation logic.

javascriptvulnerable
// VULNERABLE - fetches any URL the user provides
const response = await fetch(userProvidedUrl);
return response.text();

// SAFE - validate against an allowlist
const allowedHosts = new Set(['api.example.com', 'cdn.example.com']);
const url = new URL(userProvidedUrl);
if (!allowedHosts.has(url.hostname)) {
  throw new Error('destination not allowed');
}
// Also block private IPs after DNS resolution
const ip = await dnsResolve(url.hostname);
if (isPrivateIp(ip)) {
  throw new Error('private IP range blocked');
}
const response = await fetch(url);

Use a dedicated network policy that denies egress to private ranges. Disable unnecessary URL-fetch features entirely where possible. For cloud environments, enable IMDSv2 which requires a session token and cannot be tricked by a simple Host header manipulation.

Further reading
  • CWE-918: Server-Side Request Forgery (SSRF)(MITRE)
  • OWASP SSRF Prevention Cheat Sheet(OWASP)
  • Capital One Data Breach — Technical Analysis (Aon)(Aon Cyber Solutions)
Key takeaways

What to remember

  • SSRF turns the server into a proxy — any service the server can reach, the attacker can target.
  • Cloud metadata endpoints (169.254.169.254) are the most common SSRF target; they return IAM credentials in cloud environments.
  • Blind SSRF is harder to exploit but still dangerous — DNS lookbacks and timing side-channels can leak information.
  • An allowlist of permitted destinations is the only reliable defence. Blocking private IP ranges is the minimum baseline.
  • The Capital One 2019 breach demonstrated that a single SSRF in a WAF can expose millions of records.

Knowledge check

0/3 answered · 0 correct
  1. 1.What is the root cause of an SSRF vulnerability?

  2. 2.Why is 169.254.169.254 a common SSRF target?

  3. 3.What is the difference between blind and out-of-band SSRF?