Web Security | Difficulty: Intermediate to Advanced

SSRF Vulnerability Explained: A Deep Technical Guide to Server-Side Request Forgery

Published on: August 14, 2026

Server-Side Request Forgery (SSRF) is a vulnerability that occurs when an application allows an attacker to influence where a server-side component sends a network request.

At first glance, this can look harmless. An application may simply be fetching an image, checking whether a website is online, importing data from a URL, generating a preview, processing a webhook, or retrieving content from another service.

The problem is that the request originates from the server, not from the attacker's machine.

That difference matters.

A server may have access to internal systems, private network addresses, administrative interfaces, cloud metadata services, databases, monitoring systems, and other resources that are completely inaccessible from the public internet.

If an attacker can manipulate the destination of a server-side request, the server can unintentionally become a proxy into those otherwise protected environments.

What Is Server-Side Request Forgery (SSRF)?

Server-Side Request Forgery is a vulnerability in which an attacker can influence a server-side application or component to make a network request to a destination that the attacker should not be able to access directly.

A simplified model looks like this:

Attacker
   |
   | Malicious URL
   v
Vulnerable Application
   |
   | Server-side request
   v
Internal / Restricted Resource

The attacker does not necessarily connect directly to the internal resource.

Instead, they convince a trusted server to make the connection on their behalf.

For example, suppose an application provides a feature that checks whether a website is available:

GET /check-status?url=https://example.com

The backend might internally perform something similar to:

GET https://example.com

If the application does not properly restrict the destination, an attacker may attempt to supply a private or local address instead:

GET /check-status?url=http://127.0.0.1/admin

The vulnerable server may then request:

http://127.0.0.1/admin

From the server's perspective, 127.0.0.1 refers to the server itself.

This can expose administrative endpoints or other services that were never intended to be accessible through the public application.

Why SSRF Is Dangerous

The important part of SSRF is not simply that the server makes a request.

Servers routinely make outbound requests.

The security problem is where the server can be persuaded to connect and what the attacker can do with the resulting request.

A production server might be able to communicate with:

  • Internal REST APIs
  • Administrative dashboards
  • Private databases
  • Internal authentication services
  • Monitoring systems
  • Service-discovery endpoints
  • Container-management interfaces
  • Cloud instance metadata services
  • Other machines inside the private network
  • Local services listening on loopback interfaces

A public web application might not have direct access to these resources, but the vulnerable server may.

This creates a trust-boundary problem.

The attacker is effectively attempting to abuse the application's network position.

How SSRF Works

A typical SSRF vulnerability involves four components:

  1. An attacker-controlled input
  2. A server-side component that makes network requests
  3. Insufficient destination validation
  4. A reachable resource that should not be accessible through that functionality

Consider an application that downloads an image from a URL.

The legitimate request might look like:

POST /profile/avatar
Content-Type: application/json

{
  "image_url": "https://cdn.example.com/avatar.jpg"
}

The server retrieves the image and stores it.

If the application simply trusts the supplied URL, the attacker may attempt to change the destination to another network location.

For example:

http://127.0.0.1:8080/

or:

http://10.0.0.5/

The exact result depends on the server's network configuration, firewall rules, URL parser, HTTP client, authentication requirements, and the service running at the destination.

That last point is important: SSRF does not automatically mean successful access to an internal service.

The vulnerability creates an unintended request capability. The actual impact depends on what that capability can reach and what those services permit.

A Simple SSRF Example

Imagine a vulnerable endpoint:

GET /check-status?url=https://example.com

The backend performs a request to the supplied URL.

A normal request might be:

GET /check-status?url=https://example.com HTTP/1.1
Host: vulnerable-website.com

The application might internally perform:

GET https://example.com

Now suppose an attacker changes the URL:

GET /check-status?url=http://127.0.0.1/admin HTTP/1.1
Host: vulnerable-website.com

The server may interpret the request as:

Server → 127.0.0.1:80

If a local administrative service exists there, the application could potentially interact with it.

Whether the attacker can actually retrieve useful information depends on how the application handles the response.

Basic SSRF vs Blind SSRF

SSRF is commonly discussed in two broad forms: non-blind SSRF and blind SSRF.

Non-Blind SSRF

In a non-blind SSRF vulnerability, the application returns some or all of the remote server's response to the attacker.

Conceptually:

Attacker
   |
   | URL
   v
Vulnerable Server
   |
   | Request
   v
Internal Service
   |
   | Response
   v
Vulnerable Server
   |
   | Response
   v
Attacker

This can make exploitation easier because the attacker can directly observe the response.

For example, an application might return:

HTTP/1.1 200 OK

{
  "status": "running",
  "version": "..."
}

The attacker may therefore learn information about an internal service.

Blind SSRF

Blind SSRF occurs when the server makes the request but does not return the destination's response to the attacker.

At first, this might appear less serious.

It is not necessarily harmless.

The attacker may still be able to cause a server-side request to an unintended destination and observe indirect effects.

Depending on the application, researchers may identify blind SSRF through:

  • Timing differences
  • HTTP status differences
  • DNS interactions
  • Out-of-band callbacks
  • Changes in application behavior
  • Observable side effects
  • Requests reaching attacker-controlled infrastructure

The impact depends heavily on what the vulnerable server can reach and whether the request itself can trigger meaningful actions.

Impact of SSRF

The impact of an SSRF vulnerability can range from minor to critical, depending on what the server can access. Potential consequences include:

  • Scanning internal networks: Attackers can map out the internal network and discover other running services.
  • Accessing internal services: Attackers can interact with internal applications, databases, or APIs that are not meant to be public.
  • Information disclosure: SSRF can be used to read local files (e.g., file:///etc/passwd) or access metadata services in cloud environments (like AWS EC2), potentially leaking credentials and other secrets.
  • Remote Code Execution (RCE): In some cases, interacting with internal services can lead to executing arbitrary code on the server or other internal systems.

How to Prevent SSRF

Preventing SSRF requires a defense-in-depth approach:

  • Whitelist Allowed Domains: The most effective prevention is to maintain a whitelist of allowed domains and protocols. Instead of allowing any URL, only permit requests to specific, trusted domains.
  • Validate User Input: If a whitelist is not feasible, ensure that user input is strictly validated. For example, check if the URL starts with http:// or https:// and that the hostname belongs to an expected domain.
  • Disable Unused URL Schemas: Only allow URL schemas that are absolutely necessary. For most web applications, this means only allowing http and https. Disable schemas like file://, ftp://, gopher://, etc.
  • Network Segmentation: Isolate the server that makes external requests. It should not have broad access to the internal network. Use firewalls to restrict its outbound traffic to only what is necessary.
  • Use a Proxy for Outbound Requests: Route all outbound requests from the application through a dedicated proxy that can enforce security rules and logging.

SSRF vs CSRF

The names are similar, but SSRF and CSRF are completely different vulnerabilities.

SSRF CSRF
Server-Side Request Forgery Cross-Site Request Forgery
Abuses server-side network requests Abuses a victim's authenticated browser
Server makes the request Victim's browser makes the request
Often targets internal resources Often targets application actions
Can expose internal services Can cause unauthorized state-changing actions

The distinction is important:

SSRF abuses the server's network position.

CSRF abuses a user's authenticated browser session.

Conclusion

Server-Side Request Forgery is fundamentally a problem of trust and network reachability.

An application accepts input from an untrusted user, but then uses that input to make a request from a trusted server environment.

That difference in network position is what makes SSRF dangerous.

A vulnerable application may unintentionally allow an external attacker to interact with resources that were designed to be reachable only from inside the infrastructure.

The severity varies significantly.

A simple SSRF might reveal information about an internal service. A more serious vulnerability could provide access to administrative APIs, cloud metadata, or internal systems. In complex environments, SSRF can also become one step in a larger attack chain.

The strongest defense is therefore not a single blacklist.

A mature SSRF defense combines:

  • Strict URL parsing
  • Explicit destination allowlists
  • IP and network validation
  • IPv4 and IPv6 handling
  • Redirect controls
  • DNS-aware validation
  • Restricted protocols
  • Egress filtering
  • Network segmentation
  • Cloud metadata protections
  • Least-privilege permissions
  • Authentication on internal services
  • Monitoring and logging

Most importantly, applications should follow the principle of least privilege.

If a server does not need to communicate with an internal service, it should not have network access to that service in the first place.

SSRF is ultimately a reminder that server-side network access is a security capability. Once an application allows an attacker to influence that capability, every reachable destination becomes part of the application's attack surface.