Server-Side Request Forgery earned its place on the 2021 Top 10 in an unusual way: the security community voted it on. Its incidence rate in OWASP's data was relatively low, but practitioners ranked it first in the community survey as a rising, high-impact risk. SSRF is the vulnerability that lets an attacker make your server send requests on their behalf, turning a machine trusted inside your perimeter into a proxy that reaches places the attacker never could.

OWASP has since published a 2025 edition of the Top 10. This article covers the 2021 edition.

SSRF occurs whenever an application fetches a remote resource using a URL it accepts from the user, without validating where that URL points. The feature is common and useful: import an image from a link, call a webhook, fetch a document to preview. The flaw is that the server will fetch whatever URL it is given, including addresses the attacker could never reach directly, because they sit behind the firewall the server lives inside.

Why the internal position is the whole prize

Server-Side Request Forgery: Making the Server Attack ItselfDiagram with these labels, in reading order: ATTACKER; APP SERVER; INTERNAL / CLOUD; internal URL; unvalidated fetch; if allow-listed; Attacker; supplies internal; URL; Fetch feature; import / preview /; webhook; Metadata service; 169.254.169.254; Egress control; Destination; allow-list; IAM credentials; returned; Destination never; validated.ATTACKERAPP SERVERINTERNAL / CLOUDinternal URLunvalidated fetchif allow-listedAttackersupplies internalURLFetch featureimport / preview /webhookMetadata service169.254.169.254Egress controlDestinationallow-listIAM credentialsreturnedDestination nevervalidated
A trusted server fetches wherever it's told, including the credential endpoint.

A server usually has network reach a remote attacker does not: internal admin panels, databases, and, the crown jewel in cloud environments, the instance metadata service. On many cloud platforms, a request to a special link-local address returns configuration and, historically, credentials for the instance's role. An SSRF that reaches that endpoint can hand an attacker the keys to the cloud account. The 2019 Capital One breach is widely reported as an example: the attacker is said to have used a server-side request against a misconfigured web application firewall to retrieve role credentials from the metadata service. AWS has said SSRF was not the primary factor in that attack.

An import feature coerced into hitting cloud metadataPOST /import { "url": "http://169.254.169.254/latest/meta-data/iam/security-credentials/" }
# server dutifully fetches internal metadata and returns it to the attacker

SSRF also comes in a blind variety, where the response is not returned to the attacker but side effects still occur, internal services get poked, ports get scanned by timing, requests get smuggled. Blind SSRF is harder to exploit but no less real, and it evades naive defenses that only check whether data comes back.

Why the community chose it: SSRF sits at the intersection of web apps and cloud architecture, where a single mislaid fetch can pivot from the application layer straight into the infrastructure that runs it. Its impact outweighs its raw frequency.

Preventing SSRF

  • Allow-list destinations. Permit outbound fetches only to a known, explicit set of hosts rather than trying to block bad ones. Deny by default.
  • Validate and resolve URLs carefully. Reject internal, link-local, and private address ranges, and guard against DNS rebinding and redirect tricks that swap a safe host for an internal one after validation.
  • Segment the network. Ensure the fetching service cannot reach sensitive internal systems it has no business calling; treat outbound traffic as something to control as well as inbound traffic.
  • Harden cloud metadata. On AWS, require IMDSv2, the session-based metadata service that resists simple SSRF, and scope instance roles to least privilege so a leaked credential is worth little.
  • Do not reflect raw responses back to the user, and disable unneeded URL schemes such as file:// and gopher://.

SSRF is a reminder that the network position of your servers is itself an asset attackers covet, sometimes more than any single record. The defense depends on knowing exactly what each service is allowed to reach, and enforcing it. That map of who-can-call-what is one more thing you cannot secure until you have discovered it in full.

Primary source. A10:2021 : Server-Side Request Forgery (SSRF), OWASP.

Back to the knowledge baseRequest an assessment