SSRF via flawed request parsing
Description
This lab is vulnerable to routing-based SSRF due to its flawed parsing of the request’s intended host. This can be exploited to access an insecure intranet admin panel located at an internal IP address.
Reproduction
Send the
GET /
request that received a200
response to Burp Repeater and study the lab’s behaviour. Observe that the website validates the Host header and blocks any requests in which it has been modified.Observe that you can also access the home page by supplying an absolute URL in the request line as follows:
GET https://lab-id.web-security-academy.net/
Notice that when you do this, modifying the Host header no longer causes your request to be blocked. Instead, you receive a timeout error. This suggests that the absolute URL is being validated instead of the Host header.
Use Burp Collaborator client to confirm that you can make the website’s middleware issue requests to an arbitrary server in this way. For example, the following request will trigger an HTTP request to your Collaborator server:
GET https://lab-id.web-security-academy.net/
Host: BURP-COLLABORATOR-SUBDOMAIN
Right-click and select “Insert Collaborator payload” to insert a Burp Collaborator subdomain where indicated in the request.
Send the request containing the absolute URL to Burp Intruder. Use the Host header to scan the IP range
192.168.0.0/24
to identify the IP address of the admin interface. Send this request to Burp Repeater.In Burp Repeater, append
/admin
to the absolute URL in the request line and send the request. Observe that you now have access to the admin panel, including a form for deleting users.Change the absolute URL in your request to point to
/admin/delete
. Copy theCSRF
token from the displayed response and add it as aquery
parameter to your request. Also add ausername
parameter containingcarlos
. The request line should now look like this but with a differentCSRF
token:
GET https://lab-id.web-security-academy.net/admin/delete?csrf=QCT5OmPeAAPnyTKyETt29LszLL7CbPop&username=carlos
Send the request to delete Carlos and solve the lab.
PoC
Exploitability
An attacker will need to access the internal admin panel located in the 192.168.0.0/24
range, then delete Carlos. Note: To prevent the Academy platform being used to attack third parties, the firewall blocks interactions between the labs and arbitrary external systems. To solve the lab, use Burp Collaborator’s default public server.