At a glance
- Controls
- CWE-918 · A10:2021 Server-Side Request Forgery
What it is
Many features fetch a URL the user provides, such as a webhook, an image link or a file import. If the server does not limit where it may connect, it can be pointed at addresses only it can reach. These include internal admin services, databases and the cloud metadata endpoint.
Attackers use this to read internal pages, scan the private network and pull temporary cloud keys from the metadata service. Redirects, alternate IP formats and DNS tricks can slip past simple blocklists. AI-assisted attackers can try many bypass variants quickly against every URL field they find.
Where it hides
What a reviewer can look for in the code and in the behaviour, before anyone proves it.
- Webhook and callback URL settings
- Import from URL, link preview and image fetch features
- PDF and screenshot generators that load a page
- Integration set-up screens that test a connection
How MATT tests it
The proof runs against the deployed product, on every release, whoever wrote the code.
- 01Read the code to find every place the server fetches a URL that a user controls.
- 02Sign in as a test user and point each field at a tester-owned listener to confirm the server calls out.
- 03Submit internal and metadata addresses and harmless bypass forms, and record whether the server connects.
The server must fetch only addresses on an allowed list, never internal ones.
Executable checkas user A: POST /v1/webhooks with url "http://169.254.169.254/" expect: 400 and no outbound request as user A: POST /v1/webhooks with url to an allowed host that redirects to 127.0.0.1 expect: the redirect is refused
Every rule MATT holds →What the fix looks like
- 01
Allow outbound fetches only to approved hosts and schemes.
- 02
Resolve the hostname and reject private, loopback and link‑local addresses before connecting.
- 03
Re‑check every redirect against the same rules, or turn redirects off.
- 04
Require session tokens for the cloud metadata service and run fetchers on an isolated network.
A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →