Open Redirect Testing
Open redirects forward users to attacker-controlled URLs through a trusted domain. While lower impact than injection vulnerabilities, open redirects are used to craft convincing phishing URLs, bypass OAuth redirect_uri restrictions, and chain with SSRF when the server follows redirects. Detection confirms the application forwards to external URLs without validation.
Look for parameters named redirect, url, next, return, returnUrl, goto, dest, destination, or continue. These appear frequently on login pages, logout handlers, and post-action redirects found during parameter crawling.
Basic External Redirect Test
Supply an external URL in the redirect parameter and check whether the server redirects there:
location: https://attacker.com
A Location header pointing to attacker.com confirms an open redirect. Note the HTTP status code — 301 and 302 are both open redirects. A 200 with the redirect URL in the body but no Location header means it's a JavaScript redirect, still exploitable through a browser.
Common Parameter Names
Test the most common redirect parameter names against the login, logout, and post-auth endpoints:
redirect: 0 url: 0 next: 1 return: 0 returnUrl: 0
Filter Bypass Variants
Applications that check for external URLs often use simple validation that can be bypassed:
Protocol-relative URLs like //attacker.com bypass checks that look for http:// but are treated as full URLs by browsers. The username@@host trick fools validators that check whether the domain is present — the domain appears to be a username while the actual destination is attacker.com.
OAuth redirect_uri Abuse
Open redirects on OAuth callback endpoints allow stealing authorization codes. If an open redirect exists on the same domain as the registered redirect_uri, it can be used to redirect the code to an attacker-controlled server:
References
-
PortSwigger — OAuth Vulnerabilitiesportswigger.net/web-security/oauth (opens in new tab)
Open redirect chaining with OAuth redirect_uri validation bypass
-
PayloadsAllTheThings — Open Redirectgithub.com/swisskyrepo/PayloadsAllTheThings/tree/master/Open%20Redirect (opens in new tab)
Filter bypass payloads and URL format variants
Was this helpful?
Your feedback helps improve this page.