News for hackers. Stuff that matters.
Re:Google Chrome to stop back-button hijacking by jlebar on Wednesday December 19, 2018 @12:04AM (#18713163)
I implemented the history.pushState API in Firefox many moons ago. Dunno why I didn't add this protection then, other than, it was a simpler time. It was around then that we added the API for vibrating a phone and we all sort of said "eh, someone could abuse this, but why would they?" (In my defense on that one I was on the side arguing that they would do it specifically for ads and we needed to lock it down.)

Anyway, I approve of this change.

Re:Google Chrome to stop back-button hijacking by aerovistae on Wednesday December 19, 2018 @12:55AM (#18713403)
Can you explain how this change stops abusers while still allowing front-end routing? I’m a bit confused because they seem mutually exclusive to me, or should I say they come together or not at all.
Re:Google Chrome to stop back-button hijacking by dfabulich on Wednesday December 19, 2018 @01:18AM (#18713511)
The commit comment explains, "Entries that are added to the back/forward list without the user's intention are marked to be skipped on subsequent back button invocations."

The commit doesn't include a mechanism for marking the should_skip_on_back_forward_ui flag, but the normal way Chrome verifies "user's intention" is waiting for a gesture/click in the page.

So if you're doing front-end routing in response to a user clicking on a link or button in your UI, or swiping the page or what have you, that will allow you to pushState and then intercept the back button, as you can today.

But if you attempt to pushState on load, that's not enough to establish intention; the back button will then skip your pushed states and leave the page.

Re:Google Chrome to stop back-button hijacking by nikanj on Wednesday December 19, 2018 @03:01AM (#18714008)
A lot of seedier sites already abuse these mechanisms, by doing nasty things when you click to close a GDPR notification, focus a search box, or similar intention.

Browsers will probably never be clever enough to tell which clicks had "the right kind" of intention. The arms race continues!

Re:Google Chrome to stop back-button hijacking by ht85 on Wednesday December 19, 2018 @03:37AM (#18714162)
Yeah but in that case the malicious website should only be allowed to push a single frame, allowing you to escape by going back twice.

This is much better then the current solution where you have to long-clicking the back button and manually pick a safe entry.

Re:Google Chrome to stop back-button hijacking by Trufa on Wednesday December 19, 2018 @01:38AM (#18713576)
If I understood you correctly, if someone wanted to highjack my back history they could still do it on a random click? Is it only preventing non user interactive changes to the history or did I understand you wrong?
Re:Google Chrome to stop back-button hijacking by dannyw on Wednesday December 19, 2018 @01:40AM (#18713588)
You are correct!
Re:Google Chrome to stop back-button hijacking by wbkang on Wednesday December 19, 2018 @01:26PM (#18717950)
Is it possible for bad guys to just hijack on onmousemove? Or is that not sufficient?
Re:Google Chrome to stop back-button hijacking by juhzy on Wednesday December 19, 2018 @07:02AM (#18715049)
Chrome keeps adding new QoL features and people will wonder why everybody uses Chrome.

"why would someone abuse this" shows an incredible naivete. Anything that can be abused will be abused.

Re:Google Chrome to stop back-button hijacking by dictum on Wednesday December 19, 2018 @07:24AM (#18715126)
The parent's non-specific "many moons ago" puts the date of such naivete long in the past, when Chrome was also adding a plethora of abusable APIs.

There was a kind of "if we don't expand the web platform, native apps from walled-garden app stores will take over" discourse at the time, from all browser implementors — less so from Apple, which could hedge its bets with the App Store.