I can suggest a back arrow behind a no way sign instead, but perhaps it should be something totally different.
For example, let's say a user arrives at a single-page application from Google, and clicks a link on that page to get more information. The site adds a history entry with pushState, but doesn't reload the entire page. Are you saying that in this case, when the user clicks back they should get sent back to Google instead of to the site's home page? If so, that seems like rather unexpected behavior. And if not, isn't the attack still viable?
This is already the case, and AFAIK it's always been this way.
From [the HTML standard for pushState][1]:
> Compare newURL to document's URL. If any component of these two URL records differ other than the path, query, and fragment components, then throw a "SecurityError" DOMException.
[1]: https://html.spec.whatwg.org/multipage/history.html#dom-hist...
$(window).on('popstate', function() {
window.location.href = 'https://example.com';
});
I just tested it and it works with different domain in latest Firefox.That's not really an issue for this particular attack though, which relies on the reverse scenario: the user remaining on the current domain when they expected to navigate back to the third party search engine.
IMO "get rid of the browser history API" (as the article author recommends) isn't the right solution. The history API is important, as it's the only way to make the back button work as expected in single-page applications, or in multi-page applications that don't trigger a full page reload when you click a link. Rather, I'd suggest the following mitigations:
1. Require a user gesture for `History#pushState` and `History#replaceState`
2. Follow Firefox's example and highlight the most important part of the domain name in the browser UI
3. Don't label HTTPS sites as "Secure", as this can be misleading (Chrome's planning to do this starting next month https://blog.chromium.org/2018/05/evolving-chromes-security-... )
4. Give the back button a different icon when it's taking you to a different domain (maybe "Up" instead of "Back"?)
Any other ideas?