What is SSRF (server-side request forgery)?
Server-side request forgery (SSRF) is a vulnerability where an attacker makes your server send a request to an address they choose. Because the request comes from inside your network, it can reach internal services, admin panels and cloud metadata that are not exposed to the internet.
How it works
Features that fetch a URL for the user, such as link previews, image import, webhooks or PDF rendering, are the usual entry. If the server accepts any address, an attacker can point it at http://169.254.169.254, the cloud metadata service that hands out temporary credentials, or at localhost services like databases and admin tools. Redirects and DNS tricks can bypass simple checks: a hostname that first resolves to a public address and then to a private one defeats a check made only once.
// Vulnerable: fetches any URL it is given
app.get("/preview", async (req, res) => {
const r = await fetch(req.query.url);
res.send(await r.text());
});How to tell if your site is affected
- Your app has a feature that downloads or requests a URL supplied by a user: link preview, avatar from URL, import, webhook, proxy, screenshot or PDF.
- Your server runs in a cloud environment where the metadata address 169.254.169.254 is reachable.
- The code follows redirects automatically and checks only the first URL.
- Internal services such as databases, Redis or admin panels listen on the same private network without their own authentication.
How to fix it
Prefer an allow-list of hosts the feature may contact. If you must accept arbitrary URLs, allow only http and https.
Resolve the hostname yourself, reject private, loopback, link-local and metadata ranges, and connect to the resolved address to avoid DNS rebinding.
Check every redirect hop again, or disable redirects.
Require IMDSv2 on AWS and restrict metadata access; put a network egress rule around servers that fetch user URLs.
Set tight timeouts and response size limits, and never return raw upstream responses to the user.
How ScanAnt checks for it
ScanAnt does not run a dedicated SSRF probe against your site, because that would need requests aimed at internal addresses. Related deep scan checks, such as path-traversal and template probes, are separate. The scanner itself does enforce SSRF protection on its own outbound requests. If you have a URL-fetching feature, review it against the steps above.
Questions
Why is SSRF dangerous in the cloud?
Cloud servers can read short-lived credentials from a metadata address. If SSRF reaches it, an attacker may obtain keys with the server's permissions.
What is blind SSRF?
The server makes the request, but the response is not shown to the attacker. They still can scan internal ports by timing or trigger actions on internal services.
Is blocking "localhost" and "127.0.0.1" enough?
No. Attackers use decimal or hex IP forms, IPv6, DNS names that resolve to private addresses and redirects. Validate the resolved address, not the text.
How is SSRF different from an open redirect?
An open redirect affects the visitor's browser. SSRF affects what your server requests, so it can reach places a visitor cannot.
Related terms
Open redirect
Your site forwards visitors to any address in a URL parameter.
Read →OWASP Top 10
The ranked list of the most critical web application risks.
Read →IDOR
Changing an ID in a request exposes another user's data.
Read →Check your own site
Known CVEs, injection probes, open redirects and exposed files, in plain language.
Open the matching check →
See if your site is affected
Free for any public site, no signup. Need the verified or deep scan? Choose the level on the scan page.
Choose a scan level →