Stop 15 of 42 · The Teller Window · Server-side request forgery (SSRF)

Sending the teller to the back room

The teller offers a friendly service: “give me an address and I’ll go fetch the file for you.” Customers can only go to the public lobby, but the teller has a staff pass. Mallory points the teller at the staff-only back room, and the teller walks right in.

Severity High–CriticalCategory Injection RiskThe Teller WindowSources checked 25 Oct 2026

Watch it happen

Play it as

Mallory asks the teller to fetch a file from an address. She gives the address of the staff-only back room, and the teller brings back the keys.

Arrival

The teller offers a service: “give me an address and I’ll fetch it for you.” Alice walks up to use it. Mallory comes in behind her.

1 / 5

In bank terms and app terms

In the bankIn your app
“Fetch this address for me”A feature that fetches a URL: image import, webhook, link preview, PDF generator
Teller’s staff passThe server can reach internal services and cloud metadata that users cannot
Back room with the keysCloud metadata endpoint (169.254.169.254), localhost, databases, admin panels
List of approved addressesAllowlist of hostnames, checked after resolving the address

Are you exposed?

You might be exposed if…
  • Your server fetches a URL that came from a user: avatar import, webhook URL, “preview this link”, proxy or screenshot features.
  • Your app runs in the cloud (AWS, GCP, etc.) and the metadata service is reachable from the app.
  • You only block obvious words like “localhost” and you follow redirects automatically.
What to do about it
  1. Allow only specific hostnames you trust. Do not try to block bad ones.
  2. Resolve the address yourself, reject private, loopback and link-local IPs, connect to the exact IP you checked (DNS can change), and re-check every redirect.
  3. On AWS require IMDSv2 (a plain URL fetch can’t get a token) and give the server the least permissions possible, so stolen keys aren’t worth much.

Track these in your to-do list →

It has happened to real companies

Real-world breaches

Capital One (2019) — An attacker got in through a misconfigured web application firewall on Capital One's AWS setup (US Department of Justice), and Krebs's analysis describes the firewall being tricked into relaying requests to a back-end resource on AWS, which is the server-side request forgery pattern. Capital One reported that information on about 100 million people in the US and 6 million in Canada was affected. The attacker was convicted in 2022 of wire fraud and computer intrusion charges, and the US regulator OCC fined Capital One $80 million in 2020 for failing to establish effective risk assessment before moving major IT operations to the cloud.

Shopify — Researcher @0xacb found an SSRF in the screenshot feature of Shopify Exchange that gave root access to any container in one infrastructure subset (not Shopify core). Shopify disabled the service within an hour, paid a $25,000 bounty and added a proxy that blocks access to instance metadata.

What it looks like in code

// BAD: Fetches any URL provided by the user
export async function GET(request: Request) {
  const url = new URL(request.url).searchParams.get("url")
  const response = await fetch(url!)  // No validation
  const data = await response.text()
  return new Response(data)
}

Ask your AI tool to fix it

Paste this into Cursor, Claude, Lovable, Bolt or whatever you build with.

Prompt
Find every place the server fetches a URL supplied by a user (fetch, axios, request, image or webhook importers, link previews). Add an allowlist of permitted hostnames, resolve DNS and reject private, loopback and link-local IP ranges (including 169.254.169.254), disable automatic redirects or re-validate each hop, and set a short timeout. List the changes.

Where this comes from

The facts, figures and fixes on this page were checked against these sources on 25 Oct 2026. They are linked so you can check for yourself.

Spot a mistake or something out of date? Report a correction · How these guides are made and checked

Go deeper in isitsecure

The free, open-source scanner checks for most of the problems in these guides.