Lesson 1 of 9 · 20m
The SSRF Mental Model: Your Server Becomes the Browser
Why fetching user-controlled URLs is a network-position vulnerability, not an input-validation bug, and how to explain the blast radius to engineers.
Every SSRF explanation starts too small. "The attacker makes the server send a request" sounds like a parlor trick until you remember what the server can reach: instance metadata, the Kubernetes API, the internal admin panel with no SSO, the Redis port that assumes private means trusted. SSRF is not a request smuggling trick. It is a network-position vulnerability.
The mental model that matters
When a feature fetches a URL, your server is effectively a browser operated by whoever controls that input. Unlike a browser, it usually has:
- production credentials in environment variables or instance roles,
- routes into networks the public internet cannot reach,
- fewer TLS and UI cues to warn anyone,
- automation-friendly patience: it will follow redirects, retry, and parse responses without complaint.
attacker → public app server → internal-only service
trusted source IP no human in the loopThe attacker is not "sending requests from the server." They are borrowing the server's identity, network location, and sometimes its cloud credentials.
Where it enters real applications
The obvious feature is "import image from URL." The dangerous ones are usually quieter:
# webhook delivery
requests.post(subscription.callback_url, json=payload, timeout=5)
# link preview generation
resp = requests.get(url, timeout=3, allow_redirects=True)
metadata = extract_open_graph(resp.text)
# remote avatar or document import
resp = requests.get(profile.photo_url, stream=True)Anything that turns user input into an outbound request counts: webhooks, PDF renderers, RSS readers, uptime monitors, package importers, OAuth discovery, document converters, and "test this endpoint" admin buttons.
Impact is a spectrum
Read-only SSRF can expose data through response bodies, status codes, or timing. Write-capable SSRF can hit internal APIs that mutate state. Cloud metadata SSRF can bootstrap into full account compromise. Treating all of these as one severity is how teams both overreact and underreact.
A useful triage question is not "can they hit localhost?" It is:
- What identities does this workload carry?
- What network segments can it reach?
- Can the attacker influence method, headers, or body, or only the URL?
- Can they observe the response, or only side effects and timing?
Field notes
- "We only fetch images" is not a defense; content type checks happen after the request is made.
- SSRF severity is determined by network position, not by the elegance of the payload.
- A URL input in an internal admin tool is still user-controlled if tenants, support staff, or imported data can influence it.
- The first fix is architectural: decide whether this workload should be allowed to initiate arbitrary egress at all.
Was this lesson helpful?