1 Open Redirect for Phishing
An open redirect occurs when an application redirects to a URL from user-controlled input without validation. Attackers use trusted domain names in phishing URLs to increase click-through rates.
Vulnerable redirect:
@app.route("/login")
def login_redirect():
next_url = request.args.get("next", "/")
# After successful login:
return redirect(next_url) # No validation!An attacker crafts: https://bank.com/login?next=https://attacker.com/fake-banking-page
The victim sees a legitimate bank.com URL in the initial link, but after "logging in" is redirected to the attacker's phishing site.
OAuth token theft via open redirect:
If an OAuth authorization server accepts redirect_uri values matching an open redirect endpoint, an attacker can redirect the authorization code to their server: redirect_uri=https://victim.com/redirect?to=https://attacker.com