SSRF

In Band

The server responds with the resources specified by the end user. If the attacker specifies the payload as http://google.comarrow-up-right to a server, the latter would make the request and respond to the attacker with information served from google.com.

# Intercepted request
POST api/v1/store/products
headers…
{"inventory":"http://store.com/api/v3/inventory/item/12345"}

# Attack
POST api/v1/store/products
headers…
{"inventory":"§http://localhost/secrets§"}
 
# Response
HTTP/1.1 200 OK
headers...
{"secret_token":"crapi-admin"}

Blind

Same as In Band but does not send a response back. For this type of SSRF we need to have some control over the web server that is specified in the attack.

We can use Burp's Collaborator or free alternatives, such as:

When targeting an API for SSRF vulnerabilities, you will want to look for requests that have any of the following:

  • Include full URLs in the POST body or parameters

  • Include URL paths (or partial URLs) in the POST body or parameters

  • Headers that include URLs like Referer

  • Allows for user input that may result in a server retrieving resources

Last updated