Classification
- CWE-601 URL Redirection to Untrusted Site ('Open Redirect').
- OWASP Top 10 2021: A01 Broken Access Control.
- Severity depends on chaining; standalone findings are typically low.
How it is found
Look for parameters that control navigation: url, redirect, next, return, returnTo, continue, dest, goto, especially on login, logout and SSO endpoints. Set them to an external host and observe the response. If a check exists, try common bypasses: protocol-relative URLs (//host), backslashes, the userinfo trick (trusted.com@other.host), and encoded characters. Also check client-side redirects in JavaScript that read from location parameters.
What counts as proof
For server-side redirects, proof is a 3xx response whose Location header points at the attacker-controlled host, compared with a control value that redirects internally. Reading the header directly, without following the redirect, gives unambiguous evidence. For client-side redirects, a browser recording showing navigation to the external host is the proof. Use a non-routable sentinel domain rather than a real third party.
Remediation
Avoid taking redirect targets from user input. Where needed, accept only relative paths, or map short keys to an allow-list of destinations. If full URLs must be accepted, parse them with a proper URL parser and compare the scheme and host to an exact allow-list. Show an interstitial warning for external destinations where business needs require them.
How Pentest-Swarm tests for open redirects
Open redirect has a live, header-aware proof producer in Pentest-Swarm's verification layer.
- The adaptive sweep finds redirect-sink parameters (url, redirect, next, return and similar).
- It points them at a safe sentinel host on a reserved .invalid domain, which cannot resolve to a real third party.
- A dedicated oracle that does not follow redirects reads the Location header; a 3xx pointing at the sentinel host is the proof.
- Proven redirects can feed exploit-chain reasoning, for example against SSRF allow-lists.
Where it falls short
The oracle proves server-side 3xx redirects. JavaScript-based redirects, meta refresh and redirects only reachable after login may be missed and should be checked in a browser. Pentest-Swarm does not currently test full OAuth flows, so whether a redirect can steal authorisation codes needs manual analysis. Open redirect is not named among the headline classes in the project's COVERAGE catalogue, though its oracle producer is documented.
Questions
Is an open redirect a real vulnerability?
Yes, but usually low severity alone. It becomes higher when it enables OAuth token theft or SSRF bypass.
Do bug bounty programmes pay for open redirects?
Many exclude standalone open redirects and only reward them when chained to a higher-impact issue.
Is checking that the URL starts with my domain enough?
No. Prefix checks are bypassed with hosts such as yourdomain.com.attacker.net or userinfo tricks. Parse the URL and compare the host exactly.