Skip to content
Open redirect Write-up Intermediate

Escalating Open Redirect to XSS

The target website had an open redirect via a 'next' parameter that accepted a whitelisted subdomain and a javascript: URI. An attacker could craft a link that first redirected to a trusted subdomain and then executed JavaScript in the victim's browser, escalating the open redirect to cross-site scripting.

Sagar Sajeev Follow

Published on sagarsajeev.medium.com

In this writeup, I’ll discuss a how I was able to find a Open Redirect on a target website and escalate it to a XSS, thereby increasing the severity.

Sagar Sajeev, on sagarsajeev.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

Likely the application trusted a whitelisted subdomain in the 'next' parameter and did not block javascript: URIs, allowing script execution after the redirect.

Impact

A victim who is signed in and clicks the crafted link could have JavaScript executed in their session, potentially leading to actions such as reading cookies, though the text only demonstrates a confirm dialog.

What the attacker needed

Victim is signed into their account; victim clicks a crafted link; attacker knows a whitelisted subdomain

How it was found

  1. Open the resources page with a search term and note that the term is reflected.
  2. Try XSS in the search term without success, then look for open redirects.
  3. Manually add a 'next' parameter containing a whitelisted subdomain and a javascript: URI.
  4. Send the crafted link to a signed-in victim; they are redirected to the subdomain and the script runs.

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.

An open redirect is a flaw where a site sends you to another address given in the link, even if that address is not trusted. Here the site also allowed a 'javascript:' address, which runs code in your browser. So a crafted link could first look like it goes to a real subdomain, then run malicious script in the victim's logged-in session.

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.

More by Sagar Sajeev

View all

7 more disclosed reports, best first.

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.