Skip to content

// Vulnerability and fix

SSRF in SaaS: how to find and prevent it

6 minUpdated July 28, 2026By Ler em português

What SSRF is

SSRF (Server-Side Request Forgery) is when your server makes a request to a URL the attacker controls. It looks harmless (the server "just fetches a link"), but the server usually has access the attacker does not: the cloud metadata endpoint (which returns the instance credentials), internal services with no auth, and the private network. A silly "fetch link preview" or "import from URL" feature becomes a door inward.

Where SSRF shows up in AI-built SaaS

AI loves generating features that fetch a user URL without validating the destination. These are the common suspects.

  • Link preview, URL unfurl, importing an image/document from a URL.
  • Outbound webhook where the user sets the destination URL.
  • An integration that accepts a customer callback URL.
  • An image proxy or converter that fetches a remote resource.

How to prevent it

The defense is not trusting the URL and restricting the destination. Validate the scheme (http/https only), resolve DNS and block private/loopback/metadata IPs BEFORE connecting, and prefer an allowlist of destinations when possible. Never let the server follow a blind redirect to an internal IP.

  • Block 169.254.169.254 (metadata), 127.0.0.0/8, 10/8, 172.16/12, 192.168/16.
  • Resolve the host and validate the resolved IP, not just the URL string.
  • Beware redirects: revalidate the destination on each hop.
  • Timeout and size limit on the fetched response.

How to test and where RET fits

Test by pointing the feature at 169.254.169.254 and at an internal service: if metadata or an internal response comes back, it is SSRF. The Promptbook has the prompt to make the AI walk the URL-fetching features and flag where destination validation is missing. When the integration is critical, Risk Review reads the flow and the Manual Pentest proves the real reach.

Want to know whether this happens in your system?

Manual pentest for web applications, APIs and apps, from R$9,500, with the Sprint run within 7 business days. We refund 50% if we find no flaw.

See price and timeline for my case

Frequently asked questions

Is SSRF really serious? The server just fetches a URL.

It is serious because the server has access the attacker does not: the cloud metadata endpoint returns the instance credentials, and the internal network usually has no auth. An SSRF becomes credential theft or access to an internal service.

Is validating the URL string enough?

No. The attacker bypasses it with DNS that resolves to an internal IP, with redirects, or with alternate IP notation. The correct defense resolves the host and validates the resolved IP before connecting, and revalidates on each redirect.

How do I test without risk?

Point the feature (preview, import, webhook) at the metadata IP and at a test internal service. If data comes back, it is SSRF. The Promptbook guides that check across URL-fetching features.

Who runs it at RET?

Gabriel Lima Ferreira, founder and lead pentester, with an authorized scope and reproducible evidence.

Keep reading