NavigateEvent.sourceElement exposed to cross-origin frames
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: shannon.ml.booth, Assigned: farre)
References
Details
Attachments
(1 external file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15
Steps to reproduce
Spec PR: https://github.com/whatwg/html/pull/13090
Actual results
Firefox exposes an inaccessible element.
Expected results
sourceElement should be null when the initiator is not same origin-domain, matching Chromium and WebKit
Comment 1•1 month ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, but is not confident enough to move the bug to that component.
Comment 2•1 month ago
|
||
| frontend-triage | ||
This belongs in Core :: DOM: Navigation. The same-document fragment path in nsDocShell.cpp passes aLoadState->GetSourceElement() to the navigate event with no origin check, and Step 16 of Navigation::InnerFireNavigateEvent in Navigation.cpp copies it into init.mSourceElement unconditionally, so a same-process cross-origin iframe receives the parent's <a>. The element arrives behind an opaque wrapper, which is why the WPT times out on .tagName instead of failing.
Fix: Implement whatwg/html#13090 at that step by setting aSourceElement to null unless GetAssociatedDocument()->NodePrincipal()->EqualsConsideringDomain(aSourceElement->NodePrincipal()), then remove the TIMEOUT expectation in sourceElement-cross-origin.sub.html.ini, with the existing same-origin navigate-anchor-* and navigate-form-* WPTs guarding against over-nulling.
Suggested severity: S3. This is an interop and spec-compliance defect, and pages can only observe that a cross-origin initiator element exists, not read it, because the opaque wrapper blocks property access and cross-process loads already drop the element.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.
Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 3•1 month ago
|
||
Comment 5•1 month ago
|
||
| bugherder | ||
Updated•28 days ago
|
Description
•