consider requiring user interaction for cross-origin iframe window.top.location navigation
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox144 | --- | fixed |
People
(Reporter: bkelly, Assigned: mdauer)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete, sec-want, spec-needed, Whiteboard: [adv-main144-])
Attachments
(6 files, 2 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Updated•8 years ago
|
Updated•7 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•1 year ago
|
| Assignee | ||
Updated•10 months ago
|
| Assignee | ||
Comment 12•10 months ago
|
||
Comment 13•10 months ago
|
||
| Assignee | ||
Comment 14•9 months ago
|
||
| Assignee | ||
Comment 15•9 months ago
|
||
| Assignee | ||
Comment 16•9 months ago
|
||
| Assignee | ||
Comment 17•9 months ago
|
||
Updated•9 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
Updated•8 months ago
|
| Assignee | ||
Comment 19•7 months ago
|
||
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 20•6 months ago
|
||
| Assignee | ||
Comment 22•6 months ago
|
||
Comment 23•6 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/64540082033b
https://hg.mozilla.org/mozilla-central/rev/34abfdeecba5
https://hg.mozilla.org/mozilla-central/rev/20fbc6d90d1e
https://hg.mozilla.org/mozilla-central/rev/49381a07dfe2
https://hg.mozilla.org/mozilla-central/rev/1e1236d315cb
https://hg.mozilla.org/mozilla-central/rev/a745e721346e
Comment 24•6 months ago
|
||
Comment on attachment 9512678 [details]
WIP: Bug 1419501 - Add "DOMRedirectBlockedEvent" handling for mobile, r?freddy,maltejur
Revision D264466 was moved to bug 1988107. Setting attachment 9512678 [details] to obsolete.
Updated•6 months ago
|
Updated•6 months ago
|
Comment 27•6 months ago
|
||
FF144 MDN docs for this can be tracked in https://github.com/mdn/content/issues/41138
My understanding is that prior to this change a non-sandboxed cross-origin <iframe> could perform top navigation (if otherwise allowed by various protections such as those provided by COOP/COEP, whatever). So if an embedded iframe set window.top.location = 'https://example.com'; on frame load, this would succeed.
Following this change the navigation would fail unless the user had already interacted with some element in the embedded frame - i.e. Sticky activation. So you might set the top location using a button, but not on page load.
However this only applies to cross-origin frames - a same origin frame behaves as before.
- Is that correct?
- If the navigation is blocked, my understanding is that an error would be reported in the developer console and the page would simply not navigate. Is that right?
- How are sandboxes affected by this? Would a sandbox with
allow-top-navigationstill require user interaction for a cross-origin sandbox? (i.e. I don't know how to interpret thesandbox-cross-navigationXxxxtests in https://wpt.fyi/results/html/semantics/embedded-content/the-iframe-element?label=master) - For browser compatibility data we might add a new subfeature "cross-origin top navigation requires sticky activation"
- Does this sound reasonable?
- What versions would we use for introduction in Chrome/Safari?
Can I use the results of https://wpt.fyi/results/html/semantics/embedded-content/the-iframe-element/iframe_top_navigation_without_user_gesture_same_site.tentative.html?label=master to work this out? - i.e a pass indicates that the version requires user interaction for cross origin frames but not for same origin frames?
- Do you have a preferred MDN release note for this?
| Assignee | ||
Comment 28•6 months ago
|
||
Thanks for working on the MDN docs for this!
- Is that correct?
Yes, this is correct! :]
- If the navigation is blocked, my understanding is that an error would be reported in the developer console and the page would simply not navigate. Is that right?
Yes. If a third-party redirect is blocked, a notification appears giving the user the choice to allow the navigation. Chrome behaves the same, whereas on Safari (at least on mobile) there is no such option. The message in the developer console looks like this:
Attempting to navigate the top-level browsing context from frame with url "https://cross.origin.frame/" which is neither same-origin nor has the required user interaction.
- How are sandboxes affected by this? Would a sandbox with allow-top-navigation still require user interaction for a cross-origin sandbox? (i.e. I don't know how to interpret the
sandbox-cross-navigationXxxxtests in https://wpt.fyi/results/html/semantics/embedded-content/the-iframe-element?label=master)
This can be a bit tricky. Let me demonstrate with two examples. We have page A, page B and page C. All pages are cross-origin to each other and page A is always the top-level page.
- Case 1: Page A embeds page B with the sandbox attribute set to
allow-top-navigation. - Case 2: Page A embeds page B without a sandbox attribute. However, this time, page B embeds page C with the sandbox attribute set to
allow-top-navigation.
In case 1, page B would be allowed to navigate the top-level page.
What about case 2, should page C be allowed to navigate the top-level page? No, because page B is not allowed to.
In other words, if a page is embedded with allow-top-navigation and it tries to navigate the top-level, we check if the parent is allowed to navigate.
- For browser compatibility data we might add a new subfeature "cross-origin top navigation requires sticky activation"
Sounds good to me, I think that's the most accurate description. Other terms that we've used are "framebusting intervention" or "third-party redirect blocking".
For the versions, this is from the Intent to prototype:
- Blink: Shipped in M68 (https://chromestatus.com/feature/5851021045661696).
- WebKit: Shipped in Safari 13 (https://bugs.webkit.org/show_bug.cgi?id=193076).
I wouldn't use the web platform tests at this point, they are marked tentative and I'm actually not quite sure why we don't pass all of the iframe_top_navigation_* tests.
- Do you have a preferred MDN release note for this?
As a suggestion and feel free to change it as you see the need, maybe something like this:
Framebusting Intervention: Cross-origin frames now require sticky activation to navigate the top-level page, aligning behavior with Chrome and Safari.
Updated•6 months ago
|
Comment 29•6 months ago
|
||
Hamish: Also take a look at the upcoming SUMO article. It may also help explain what is going on. Revision history should allow you to view the upcoming article at https://support.mozilla.org/en-US/kb/pop-blocker-settings-exceptions-troubleshooting/history.
Furthermore, a potentially interesting difference between the browsers that we observed
- Firefox prompts the user and logs to console
- Chrome prompts the user and logs to console
- Safari always blocks.
Updated•5 months ago
|
Description
•