How I found Open Redirect on Hashnode.com
The login page's 'next' parameter allowed redirects to a small allowlist of domains, but using a double backslash bypassed the check and redirected to an arbitrary site. An attacker could craft a login link that sends victims to a malicious site after authentication.
Published on gonzx.medium.com
Good day to all Bug Hunters again I’m Jefferson Gonzales and today I will share my findings on Hashnode.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 redirect allowlist was checked against the raw parameter value, and the double backslash was normalised by the browser or server into a protocol-relative URL that pointed to an external domain.
Impact
An attacker could craft a login link that redirects victims to an arbitrary site after authentication, which could be used for phishing.
What the attacker needed
Victim clicks a crafted login link; victim logs in
How it was found
- Log in to Hashnode and observe the login URL contains a 'next' parameter.
- Change the 'next' value to an external domain and log in again to see the redirect.
- Notice that only a few domains are allowed.
- Use a double backslash before the external domain in the 'next' parameter.
- Log in again and observe the redirect to the external 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 website lets you choose where to send someone after they log in. Here, the site tried to limit redirects to a few trusted sites, but a trick with backslashes got around that limit. This matters because attackers can use the trusted site's link to send people to a fake page that steals passwords.
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.