An open redirect is proven when a parameter on your domain causes a 30x to a host you control. It matters because it turns your domain into a credential-phishing link and, in OAuth flows, can leak a token to the attacker.
Where this class of bug actually lives in any parameter that carries a URL or a path
- Return-to parameters.
?next=,?redirect=,?returnUrl=,?continue=on login and logout. - OAuth callbacks. A
redirect_urithat is matched by prefix instead of exact equality hands the code to any host on that prefix. - Link and invite flows. "Open in app" handlers that trust a deep link target.
- Path-based redirects.
//evil.exampleand/\\evil.example, which browsers read as scheme-relative.
What to try first
- Send
https://your-canary.examplein every URL-ish parameter and watch for a 302 to it. - Try the bypass set:
//host,/\\host,https:host,https://yourdomain.com@host, and a relative path on your domain that itself redirects. - For OAuth, register a callback that starts with an allowed prefix and see whether it is accepted.
- Check whether the redirect happens before or after login — before is unauthenticated and worse.
A reproduction you can keep
One parameter, four payloads. The Location header is the result:
for p in \
'https://your-canary.example' \
'//your-canary.example' \
'/\\your-canary.example' \
'https://offense.sh@your-canary.example'; do
echo "== $p"
curl -sS -o /dev/null -D - --get 'https://staging.example.com/login' \
--data-urlencode "next=$p" | grep -i '^location:'
done
# vulnerable: any Location pointing at your-canary.example
# fixed: all Location values are relative paths on offense.exampleWhat "fixed" has to look like
Accept only relative paths, or match the target against an exact allowlist of hosts, and reject anything else before issuing the redirect. Verify the full bypass set above, including the userinfo form and the scheme-relative one.
Where people get this wrong
- A prefix check on the hostname (
startsWith('https://yourapp.com')) acceptshttps://yourapp.com.attacker.example. - Validating on the server but redirecting client-side with the raw value undoes the check.
- In OAuth, prefix matching on
redirect_uriis a token theft, not just a phishing link.
What Offense does here
Offense runs an agent swarm against your app in a disposable sandbox, keeps the request, the identity and the vulnerable response as evidence, and replays the same attack after the fix so the retest is a control comparison rather than a green check. It does not read your source and it does not patch your code: the finding goes to your coding agent with the reproduction attached. The hosted workspace is invite-only — join the waitlist — and the free dependency audit in /install needs no account.
Questions this page answers
Is an open redirect worth fixing?
Yes. It makes your domain a credible phishing link and, in an OAuth flow, can deliver an authorization code to an attacker.
What validation actually works?
Relative paths only, or exact-match an allowlist of full origins. Substring and prefix checks are the bug.
Written by Offense Research, reviewed December 2, 2026. Correct something? Email imran@offenseresearch.com.