Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow same-document navigation? #138

Closed
Treora opened this issue Aug 20, 2020 · 3 comments
Closed

Allow same-document navigation? #138

Treora opened this issue Aug 20, 2020 · 3 comments

Comments

@Treora
Copy link
Contributor

Treora commented Aug 20, 2020

In the algorithm to “determine whether a navigation should allow a text fragment”, step 3 forbids applying a text fragment when performing a user-triggered navigation within the same page:

  1. If the document of the latest entry in document’s browsing context's session history is equal to document, return false.

i.e. Forbidden on a same-document navigation.

I wonder, what kind of risk would this mitigate?

I had noticed this behaviour while trying the polyfill playground in Chromium, but assuming it was simply a bug I adjusted the polyfill to make up for it (a bit hacky, by listening for link clicks). But now I got a little confused as it appears to behave according to spec; while unless I overlook something, this looks like a relatively risk-free scenario, and the behaviour differs from how normal fragment identifiers are handled. Any clues?

@bokand
Copy link
Collaborator

bokand commented Sep 16, 2020

Similarly to #137, this is a (maybe mildly paranoid) fear of attackers finding a way to navigate and observe a text-fragment navigation on a page. The thought was that full navigations are slower, more noisy, and more user-visible that this risk was somewhat reduced. Additionally, pages that want to do this same-doc can achieve it with some script (though I agree that's an unfortunate thing to ask authors to do).

IMHO, I feel this one is a bit more shaky than #137 and would be supportive of seeing if we can remove it. I'd have to check with Chrome security if they'd be comfortable with that.

@bokand
Copy link
Collaborator

bokand commented Dec 13, 2023

I think I just forgot to update this issue, both Chrome and the spec no longer restrict same-document navigation (with some caveats around user gestures and window opener restrictions).

@bokand bokand closed this as completed Dec 13, 2023
@bokand
Copy link
Collaborator

bokand commented Dec 13, 2023

Err - correction, same-document navigation was still restricted by spec but I just merged #239 which fixes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants