Open Redirect
Open Redirection in the POST method
Summary
🐞 Open Redirection vulnerability in a POST parameter. Open redirect occurs when a web page is being redirected to another URL in another domain via a user-controlled input.
Impact
🐞 Because the vulnerability can be only exploited via POST requests, its impact is very limited and it cannot be directly used for common Open Redirect attacks such as phishing.
Remediation
🐞 **Remediation**
If you definitely need dynamic URLs, use whitelisting. Make a list of valid, accepted URLs and do not accept other URLs.
Where possible, do not use users' input for URLs.
Ensure that you only accept URLs those are located on the trusted domains.
Bypasses Payloads
Open Redirect to XSS
Open Redirect to SSRF
Visit a product, click "Check stock", intercept the request in Burp Suite, and send it to Burp Repeater.
Try tampering with the
stockApi
parameter and observe that it isn't possible to make the server issue the request directly to a different host.Click "next product" and observe that the
path
parameter is placed into the Location header of a redirection response, resulting in an open redirection.Create a URL that exploits the open redirection vulnerability, and redirects to the admin interface, and feed this into the
stockApi
parameter on the stock checker:/product/nextProduct?path=http://192.168.0.12:8080/admin
Observe that the stock checker follows the redirection and shows you the admin page.
Amend the path to delete the target user:
/product/nextProduct?path=http://192.168.0.12:8080/admin/delete?username=carlos
Redirect to localhost or arbitrary domains
Code Examples
.Net
Java
PHP
Mitigation code
Open Redirect when uploading svg files
Open Redirect when uploading svg files
Common injection parameters
Last updated