Open Redirect to XSS
A login redirect parameter accepted crafted slash and encoding variants that bypassed a basic filter, allowing redirection to an external site. The same parameter also accepted a javascript URI, so after login the browser executed attacker script on the target domain.
Many bug bounty hunters overlook Open Redirect vulnerabilities, thinking they are “just a phishing vector.” But what if I told you that a redirect parameter could lead to full-blown Javascript execution? Today, I will share my journey of how I discovered an Open Redirect and escalated it to a rewarding XSS…
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 redirect parameter was validated with a weak filter that did not normalise slash and encoding variants and did not restrict the allowed URI schemes.
Impact
An attacker could send a crafted login link that, after the victim logs in, runs script on the target domain, which could be used to act as the victim; the text does not show any defence blocking this.
What the attacker needed
Victim clicks a crafted login link; victim logs in
The fix
The redirect parameter should be validated against a strict allowlist of relative paths or trusted hosts and should reject non-http schemes such as javascript.
How it was found
- Find the redirect parameter on the login page.
- Try an external URL and observe it is blocked.
- Try slash and encoding variants until one redirects to the external site.
- Try a javascript URI in the same parameter.
- Log in and observe script execution on the target domain.
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 when a site lets a link send you to any other site, which is often used for phishing. Here the login page had a parameter saying where to go after login, and a filter blocked the obvious external address but not some slash and encoding tricks. The same parameter also accepted a javascript address, so the browser ran the attacker's code on the trusted site itself, which is cross-site scripting (XSS).
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.