Blog/Vulnerabilities

Server-Side Request Forgery: Making the Server Do the Asking

SSRF turns your server into the attacker's proxy. Why cloud metadata made it serious, how it bypasses firewalls, and the defenses that actually hold.

CyberWatch AI24 November 2026 · 7 min read
A hotel concierge desk with a telephone and a bell on the counter

Picture a hotel concierge. Guests hand over addresses and the concierge collects things on their behalf. The concierge has keys to the back offices, a staff pass for the service lift and an account with the suppliers. A guest who writes down the address of the manager's safe rather than a restaurant has not broken into anything. They have asked someone with better access to go there for them.

That is server-side request forgery. The application fetches a URL the user supplied, and the attacker's gain is not the content of the page. It is the server's position: inside the network, past the firewall, holding an identity the internet does not have.

The mechanism

OWASP's definition is compact and worth reading closely. SSRF flaws "occur whenever a web application is fetching a remote resource without validating the user-supplied URL. It allows an attacker to coerce the application to send a crafted request to an unexpected destination, even when protected by a firewall, VPN, or another type of network access control list."

The last clause is the whole point. Perimeter controls assume requests to internal services come from inside and requests from outside arrive at the perimeter. SSRF produces a request that is, by every measure the network can see, internal and legitimate. MITRE tracks it as CWE-918.

The features that create it are ordinary and useful. An application that generates a preview of a pasted link. A document converter that downloads referenced images. A webhook setting where a customer supplies a callback address. An import tool that accepts a file by URL. A single sign-on component that retrieves identity provider metadata from a configured endpoint. In each case fetching a user-supplied address is the feature, which is why SSRF rarely looks like a bug in code review.

OWASP's own note on why the category was added to the 2021 Top 10 is candid: the data showed a relatively low incidence rate, but the exploit and impact potential ratings were above average, and the category was added on the strength of the community survey. That combination describes it well. Not common, and disproportionately consequential when present.

Four things an attacker does with it

OWASP sets out the attack scenarios directly, and they escalate.

Mapping the internal network. Where the architecture is unsegmented, differences in connection results or in how long a request takes to be accepted or refused reveal which internal hosts and ports exist. This works even when no response body ever reaches the attacker.

Reading what the server can read. If the URL handling accepts schemes other than HTTP, file:///etc/passwd becomes a valid destination. Internal services listening on localhost, which are frequently unauthenticated precisely because they are not meant to be reachable, become readable too.

Taking the cloud instance's credentials. This is the change that moved SSRF from an interesting finding to a top-tier risk. Cloud platforms make instance configuration available over a link-local HTTP address; OWASP cites http://169.254.169.254/. In older metadata designs a plain unauthenticated GET to that address could return temporary credentials for the role attached to the instance. An attacker who obtains those is no longer attacking a web application. They are authenticated to the cloud account with whatever permissions that role carries.

Attacking internal services outright. Internal administrative interfaces, message brokers, caches and search clusters are commonly deployed with no authentication on the assumption that only trusted peers can connect. SSRF makes the application a trusted peer that takes instructions from strangers.

What it looks like in real advisories

SSRF appears in CISA's catalog of exploited vulnerabilities often enough that CWE-918 is a recurring tag, and three cases illustrate the different shapes.

As an authentication bypass. CVE-2021-26855 in Microsoft Exchange Server is the best-known example. CISA's advisory describes it as exploiting the Exchange Control Panel via a server-side request forgery, allowing "an unauthenticated attacker to send arbitrary HTTP requests and authenticate as the Exchange Server." Attackers chained it with post-authentication arbitrary file write flaws, CVE-2021-26858 and CVE-2021-27065, and with CVE-2021-26857, which the same advisory describes as an insecure deserialization flaw in the Unified Messaging service allowing code execution as SYSTEM. The SSRF was the key. Everything after it required authentication the SSRF had already provided.

As a credential theft route. The CVE record for CVE-2021-21975 states that server-side request forgery in the VMware vRealize Operations Manager API, in versions prior to 8.4, may allow an actor with network access to the API to perform an SSRF attack to steal administrative credentials.

As a link in an appliance chain. CVE-2024-21893 is described in its CVE record as an SSRF flaw in the SAML component of Ivanti Connect Secure and Policy Secure, allowing an attacker to access certain restricted resources without authentication. It was scored 8.2 and was added to CISA's catalog in January 2024 alongside the other Ivanti gateway flaws of that period, with known use in ransomware campaigns recorded. SSRF in an authentication component of an internet-facing gateway is a particularly bad combination, because the component's job is to talk to other systems on your behalf.

Why the obvious defenses fail

Most first attempts at fixing SSRF are a check on the submitted URL, and most of them are bypassed. The reason is that a destination can be expressed in far more ways than a filter anticipates.

  • Alternative representations of the same address. Decimal, octal, hexadecimal and shortened forms of an IPv4 address all resolve to the same host. IPv6 adds mapped and compressed forms.
  • Hostnames you do not control the resolution of. A perfectly ordinary public domain name can resolve to a private address. The filter sees a hostname that passes.
  • Redirects. The supplied URL points somewhere permitted, and the response is a redirect to somewhere internal. If the HTTP client follows redirects, validation happened on the wrong URL.
  • Time-of-check to time-of-use. DNS rebinding resolves a name to an allowed address when the application validates it and to an internal one when the application connects moments later. OWASP calls this out specifically, advising awareness of URL consistency to avoid DNS rebinding and TOCTOU race conditions.
  • Parser disagreement. The library used to validate the URL and the library used to fetch it may disagree about where a credential, fragment or unusual character ends and the host begins.

OWASP's guidance on this is unambiguous: "Do not mitigate SSRF via the use of a deny list or regular expression. Attackers have payload lists, tools, and skills to bypass deny lists."

What actually works

SSRF is one of the cases where the network control is stronger than the code control, which is why OWASP lists the network layer first.

At the network layer

  • Segment the fetching functionality. Put the component that retrieves user-supplied URLs in its own network segment with nothing valuable adjacent to it. This is the single most effective measure, because it limits what a successful SSRF can reach regardless of how it was achieved.
  • Deny by default on egress and on internal traffic. Block everything except the flows the application genuinely needs, and give firewall rules a named owner and a lifecycle so they do not accumulate. Log accepted and blocked flows.
  • Block the metadata address explicitly from any process that fetches user-supplied URLs.

At the application layer

  • Allowlist the schema, port and destination. A positive allowlist of permitted targets is the only validation approach that holds. If the feature only ever needs to reach three known partners, it should be incapable of reaching anything else.
  • Resolve first, validate the resolved address, then connect to that address. This closes the rebinding gap, because the address that was checked is the address that is used.
  • Disable HTTP redirection in the fetching client, or re-validate each hop.
  • Do not return the raw response to the client. Returning status codes, headers and bodies turns a blind SSRF into a full read primitive.
  • Keep other security-relevant services off the front-end systems, and control localhost traffic on them. OWASP lists both as additional measures, and they matter because an unauthenticated service on localhost is the easiest thing for an SSRF to hit.

At the cloud platform

Harden the metadata service rather than relying on the application. AWS documents a session-oriented metadata service, IMDSv2, which requires the caller to obtain a token with a PUT request before reading metadata, and which can be enforced so that the older method is rejected. That change defeats the simple SSRF-to-credentials path, because a flaw that can issue a GET usually cannot issue the required PUT with custom headers. Equivalent protections exist on other platforms, and our cloud security guide covers the surrounding configuration work.

Suspicious link in a message rather than a server log? Paste it into CyberWatch AI Scan for a free check before you open it.

The short version

SSRF is a flaw in which your server makes the attacker's request. It defeats perimeter controls by construction, because the request is internal. Its impact grew sharply with cloud computing, where a request to a link-local address can return credentials for the whole account.

URL filtering is the instinctive fix and the weakest one. What holds is an allowlist of permitted destinations, resolving and validating the actual address before connecting, refusing to follow redirects, and placing the fetching component somewhere that reaching the rest of your network is not possible. For the broader exposure question of what your servers can talk to, see our network security guide, and for how a flaw like this gets prioritized against everything else on the list, our vulnerability management guide.

Frequently asked questions

What is server-side request forgery?

A flaw where an application fetches a remote resource using a URL the user supplied, without properly validating it. The attacker chooses the destination, so the server makes a request on their behalf from inside your network.

Why is SSRF serious if it only fetches a web page?

Because the request comes from your server, not from the internet. It arrives with the server's network position, its source address, and sometimes its credentials attached. Internal services that are unreachable from outside and trust anything on the local network become reachable.

What is the cloud metadata endpoint and why does it matter?

Cloud platforms expose configuration and temporary credentials to an instance over a link-local HTTP address, which OWASP cites as 169.254.169.254. An SSRF flaw that reaches it can read credentials for the instance's role, which converts a web bug into cloud account access.

What is blind SSRF?

SSRF where the response is not returned to the attacker. It is still exploitable: timing and error differences reveal whether a port is open, and requests with side effects, such as triggering an internal action, work without any response at all.

Can a firewall stop SSRF?

Not on its own, because the request originates inside the perimeter. Egress filtering from the application server and deny-by-default internal network rules both help a great deal, which is why OWASP lists network segmentation as the first prevention control.

Why are denylists the wrong defense?

Because the ways to express a destination are effectively unbounded: alternative IP encodings, redirects, DNS names resolving to internal addresses, and addresses that change between validation and use. OWASP states plainly that SSRF should not be mitigated with a denylist or regular expression.

What is DNS rebinding in this context?

The attacker supplies a hostname that resolves to a permitted address when the application checks it, then to an internal address when the application connects. The validation passed and the connection still went somewhere else. OWASP groups this with time-of-check to time-of-use problems.

Does SSRF only affect web applications?

No. Anything that fetches a URL on a user's behalf can have it: document converters that follow image references, webhook configuration, link preview generators, PDF renderers, XML parsers that resolve external entities, and single sign-on components that fetch metadata from a supplied address.

Sources

  1. A10:2021 Server-Side Request Forgery (SSRF), OWASP
  2. CWE-918: Server-Side Request Forgery (SSRF), MITRE
  3. Server Side Request Forgery Prevention Cheat Sheet, OWASP
  4. Mitigate Microsoft Exchange Server Vulnerabilities, US Cybersecurity and Infrastructure Security Agency
  5. CVE-2024-21893, CVE Program
  6. CVE-2021-21975, CVE Program
  7. Use IMDSv2, Amazon Web Services
  8. Known Exploited Vulnerabilities Catalog, US Cybersecurity and Infrastructure Security Agency
Share this article
LinkedIn WhatsApp X
For organizations

Your people get these messages at work too.

CyberWatch AI sends your staff realistic practice attacks, trains the gaps it finds, and shows management exactly where the organization stands.