Course contentsShow
← Security
Lesson 1142 of 3,05223. Web Security - Modern Web AttacksFree lesson

Open Redirect Attack Vectors

Exploring common redirect parameters, DOM-based redirects, and how attackers exploit URL validation weaknesses.

Open Redirect Attack Vectors

What you'll learn: You'll discover the common techniques attackers use to exploit redirect functionality and bypass URL validation in web applications.

The Core Idea

Now that you understand open redirect fundamentals, let's explore how attackers actually exploit them. Attackers look for weak spots in how applications handle redirect URLs—typically through parameter manipulation, DOM-based redirects, or flawed validation logic.

Common Attack Vectors

Redirect Parameters

The most obvious vector is through URL parameters:

https://trusted-site.com/redirect?url=https://evil.com
https://trusted-site.com/login?next=/dashboard
https://trusted-site.com/logout?returnUrl=//attacker.com

Attackers test parameters like url, redirect, next, return, goto, destination, and variations.

DOM-Based Redirects

JavaScript can create client-side redirects using user-controlled data:

// Vulnerable: reads from URL fragment
window.location = location.hash.substring(1);

// Attacker uses:
// https://trusted-site.com#https://evil.com

The redirect happens entirely in the browser, making server-side validation useless.

Validation Bypass Techniques

Attackers exploit weak URL validation with tricks like:

  • Protocol-relative URLs: //evil.com (inherits current protocol)
  • Subdomain confusion: trusted-site.com.evil.com
  • URL encoding: https%3A%2F%2Fevil.com
  • Backslash substitution: https://trusted-site.com\@evil.com
  • Open redirects on whitelisted domains: Chain trusted redirect to bypass checks
  • JavaScript protocol: javascript:alert(document.domain)

Think of it like a bouncer checking IDs: if they only look at the first name and not the full document, someone can sneak through with a fake.

Key Takeaway: Attackers exploit open redirects through parameter manipulation, DOM-based redirects, and creative bypass techniques that exploit weak URL validation—defenders must validate both scheme and full hostname, never trust client-side data, and avoid blacklist approaches.