Phishing with history.back() open redirect
A page that calls history.back() or history.go(-n) can be made to send the user to a different page than the one they actually visited, because the attacker's page rewrites its own history entry with history.replaceState. An attacker could use this as an open redirect and phishing vector, including via a Google accounts endpoint that takes a backstep parameter.
Published on medium.com
While participating in a private bug bounty program I ran into a WAF error page that contained details about the request as well as a hyperlink that would send the user back one page. After playing around with some javascript, I was able to use this technique as an open redirect on all buttons that use the…
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 vulnerable page trusts the browser history stack and navigates back without checking where the previous entry actually points, while an attacker page can rewrite its own history entry to a different URL.
Impact
The technique could be used as a phishing vector to send a target to a page they never visited, though the report notes it was only demonstrated in a lab environment and the Google submission was not accepted.
What the attacker needed
Victim clicks attacker link; target page uses history.back()
The fix
The back navigation should not rely on an unvalidated history entry; the site should verify the destination or avoid history-based redirects entirely.
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.
Browsers keep a list of pages you visited so the back button works. A page can quietly rename its own entry in that list using a browser feature called replaceState. If a site's back button simply goes back one step, it can land on a page you never actually visited, which an attacker can use to send you to a fake login page.
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.