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.
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.
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
- Open the resources page with a search term and note that the term is reflected.
- Try XSS in the search term without success, then look for open redirects.
- Manually add a 'next' parameter containing a whitelisted subdomain and a javascript: URI.
- 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.