Skip to content
Open redirect Write-up Beginner

DOM-Based Open Redirection

The application's client-side JavaScript extracts a 'url' parameter from the current URL and assigns it to location.href without validation, enabling DOM-based open redirection. An attacker can craft a link that redirects victims to an arbitrary external domain, such as a phishing page.

medium.com

Published on medium.com

DOM-based open redirection is a client-side vulnerability where redirection logic is handled entirely in the browser using JavaScript and relies on untrusted data from the URL.

Bash Overflow, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The client-side script takes a URL parameter from the address bar and uses it directly as a redirect destination without checking that it points to a trusted domain.

Impact

Attackers can use the trusted domain to redirect users to phishing sites, credential harvesting pages, or malware downloads, and users are more likely to trust the link because it originates from a legitimate website.

What the attacker needed

Victim clicks a crafted link; attacker controls the url parameter

How it was found

  1. Open the lab and select a blog article.
  2. Attempt to submit a comment with a redirection payload; observe it does not execute.
  3. View the page source and locate the JavaScript that handles client-side navigation.
  4. Copy the exploit server URL provided by the lab.
  5. Append a 'url' parameter containing the exploit server link to the blog post URL.
  6. Load the modified URL and verify the redirect by checking the exploit server's access log.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Open redirection is when a trusted website sends you to a different site without warning. Here, the site's own JavaScript reads a web address from the link you clicked and automatically takes you there, even if it's an attacker's site. This can be used to trick people into visiting fake login pages that look like they belong to the trusted site.

What is Open redirect?

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.