The rules for choosing a navigable "_parent" lets a cross-origin child navigate a parent != top, but implementations block it
What is the issue with the HTML Standard?
Assume a page with two nested iframes
Main document (Origin A)
|---> iframe1 (Origin A)
|---> iframe2 (Origin B)
when iframe2 is cross origin from iframe1 and iframe2._parent != iframe2._top and try to run
window.open(URL,"_parent")
most browsers stops the navigation and mark it as unsafe but the specs allows it (as per rules of choosing the _parent)
the rules for choosing a navigable
-
Otherwise, if name is an ASCII case-insensitive match for "_parent", set chosen to currentNavigable's parent, if any, and currentNavigable otherwise. in our case this resolves parent
-
If sourceDocument's node navigable is not allowed by sandboxing to navigate navigable given sourceSnapshotParams... If exceptionsEnabled is true, then throw a "SecurityError" DOMException. 2. Return. in our case this is not sandboxed
-
If target is not a top-level traversable, then return true. in our case its not top-level
to test this: WPT: https://phabricator.services.mozilla.com/D320401