Server-side request forgery (SSRF) happens when your server fetches a URL that a user gave it. AI-built apps add this feature all the time: "import from URL", link previews, image fetchers, webhook testers, PDF generators. If the URL is not checked, an attacker points it at addresses only your server can reach.

1. Where it hides

  • A "paste a link" box that fetches the page to build a preview
  • Avatar or image upload "from URL"
  • A webhook field with a "send test" button
  • HTML-to-PDF or screenshot endpoints
  • Any route that calls fetch(req.body.url) or requests.get(url)

2. What an attacker aims for

  • Cloud metadata at 169.254.169.254, which can hand out cloud credentials on some setups
  • localhost and 127.0.0.1 admin ports and internal dashboards
  • Private ranges such as 10.x.x.x, 172.16.x.x and 192.168.x.x
  • Internal service names your platform exposes inside its network

3. A safe test on your own app

  1. Find a feature that fetches a URL you supply.
  2. Run a throwaway server you control, or use a request-catcher URL, and give the feature that address. If you see a hit from your server's IP, the fetch happens server-side.
  3. Try http://localhost and see whether the response or the error text changes. Fast errors versus slow timeouts differ, and either one tells you the app tried to connect.
  4. Stop there. Only test your own app.

4. Fixes that hold up

  • Allow only https and, where you can, a short list of allowed hosts.
  • Resolve the hostname yourself, then reject private, loopback and link-local addresses before connecting.
  • Check again after every redirect, or turn redirects off.
  • Do not return raw fetched content or full error messages to the user.
  • Run the fetcher with no access to internal services or cloud credentials.
  • If your host offers a setting that requires a token for metadata requests, turn it on.

What an outside scan can and cannot tell you

An outside scan does not know which of your features fetch URLs, and it never submits forms, so it cannot confirm SSRF. Treat this as a manual check on every "enter a URL" feature before launch.

Check your own app from the outside, free. Run the free ProofForge scan on your live URL. No account needed for the first scan. It looks at your public site the way a stranger would and says pass, fail or inconclusive, so you know what is confirmed and what it could not see. One-time reports start at $9: see pricing. Building with an AI agent? There is an MCP server so it can check before it deploys.