Short answer
Server-side request forgery (SSRF) is when your server fetches a URL that a user controls without checking where it points. The request then comes from your server, so it can reach internal services, cloud metadata endpoints or other systems that trust your server. In AI-built apps it appears in link previews, image imports and webhook testers inside edge functions. Allow only known hosts and don’t follow redirects.
Ask an AI about this page:ChatGPTClaude
On this page
Server-side request forgery (SSRF) is a weakness where a server fetches a URL supplied by a user without making sure the request goes where it should. MITRE files it as CWE-918 (opens in a new tab). The user can’t reach your internal network directly, but your server can, so the server becomes their proxy. The OWASP cheat sheet names typical targets: internal services, localhost, private address ranges and the cloud metadata address 169.254.169.254, which can hand out credentials in AWS, Azure and GCP.
SSRF in an AI-built app
Ask an AI builder for “paste a link and we show a preview” or “import an image from a URL” and you often get an edge function like this:
const { url } = await req.json();
const res = await fetch(url);
const html = await res.text();
return new Response(JSON.stringify({ title: extractTitle(html) }));Whatever the user sends, the function fetches. Any URL the server can reach is now reachable for the user, and if the function returns the response body, they can read it too. The same pattern appears in webhook testers, “fetch my RSS feed” features, PDF generators that load remote pages and AI features that let a model call a “fetch URL” tool.
How to check your app
- Search your server code (edge functions, API routes, workers) for
fetch(,axios,got(and similar calls, and look for any whose URL comes from the request body, the query string, a database field users can write or model output. - For each, ask: which hosts can this reach? Is there an allow-list? Are redirects followed?
- A
fetchto a fixed, configured host such as your payment provider’s API is not SSRF.
How to fix or prevent it
The OWASP cheat sheet’s main advice, in short:
- Allow-list the destinations. If the feature only needs a few hosts, accept only those. Build the URL yourself instead of passing the user’s string through.
- Turn off redirects in the HTTP client (
redirect: "manual"withfetch), so an allowed URL can’t bounce to an internal one. - If you must accept arbitrary hosts, allow only
https, resolve the host, and reject private, loopback and link-local addresses. OWASP warns that deny-lists are easy to get wrong and that DNS can change between your check and the request. - Never return raw responses when a title or a thumbnail is all you need.
More on securing functions is in Securing Supabase Edge Functions. SSRF is part of A01 Broken Access Control in the OWASP Top 10 2025.
Frequently asked questions
Is fetching a URL in the browser SSRF?
No. SSRF needs a server that makes the request on the user’s behalf. A fetch in your React code runs in the user’s own browser with the user’s own network access.
Is checking that the URL starts with https enough?
No. The host still matters, and a harmless-looking host can redirect or resolve to an internal address. OWASP recommends an allow-list of hosts, checking the resolved IP addresses and turning off redirects.
Where did SSRF go in the OWASP Top 10 2025?
In 2021 it was its own category (A10). In the 2025 edition it is part of A01 Broken Access Control, which lists CWE-918 among its mapped weaknesses. The OWASP API Security Top 10 2023 still lists it separately as API7.
Sources
- 1.Server Side Request Forgery Prevention Cheat Sheet — OWASP Cheat Sheet Series
- 2.CWE-918: Server-Side Request Forgery (SSRF) — MITRE
- 3.A01:2025 Broken Access Control — OWASP Top 10
- 4.OWASP Top 10 API Security Risks – 2023 — OWASP API Security Top 10