Open Redirect
Definition
Open Redirect (or OPR) occurs when a web application redirects a user to an URL without properly validating the redirect target.
OPR to XSS
When you have a client-side redirection using window.location = target
, you can trigger an XSS attack using the javascript:
protocol. Example:
OPR to External URLs
Open Redirect to external URLs can enhance the success rate of phishing attacks if victims trust the main domain, but it still requires user interaction from the victim.
Example: https://example.com?redirect=https://evil.com
Execution After Redirect (EAR)
Execution After Redirect happens when a server redirects a user but executes code on the server before the redirection occurs. Example:
You can access the private content in the response body if the execution is not terminated after the redirection.
Fix using the exit
function in PHP:
Follow redirects
Follow redirects refers to the process where an HTTP client automatically proceeds the redirection. Examples:
OPR on famous websites
Open Redirect is not considered a vulnerability by Google, so they will not fix the following ones: