Site isolation frame validation in DidDestroyFrame, FrameNameChanged and SetFramePrinting
Under site isolation, an iframe could tear down a sibling it never owned
Component: WebKit Site Isolation | bd2c66d
LayoutTests/http/tests/site-isolation/did-destroy-frame-validation.html
Under site isolation, the UI process keeps the authoritative frame tree (WebFrameProxy) and relays frame lifecycle changes between WebContent processes. Frame-level IPC messages carry a FrameIdentifier chosen by the sender. Unless the UI process checks that the frame belongs to the receiving WebPageProxy and that the sender legitimately owns or parents it, a compromised renderer can act on frames it does not control.
WebPageProxy::didDestroyFrame, frameNameChanged, and setFramePrinting now fail a MESSAGE_CHECK when the frame belongs to a different page, and they silently ignore messages from processes that aren't allowed to send them. Each message has a different allowed-sender set, because legitimate flows (a parent's provisional process during a cross-site navigation, an old process reporting child removal after the main frame commits elsewhere) complicate the rules:
Message Frame's proc Parent's proc Parent's provisional Any proc
DidDestroyFrame yes yes yes only if no parent
FrameNameChanged yes no no no
SetFramePrinting yes yes no no
frame->page() != this page => MESSAGE_CHECK failure (kills sender)
sender not in allowed set => ignored
unknown frame => early return (didDestroyFrame still broadcasts removal)
Significance
A compromised iframe process could previously remove a sibling iframe, rename or print the main frame, or name frames belonging to other pages. The UI process is the trust boundary site isolation depends on, and these handlers were trusting sender-chosen IDs.
Audit directions
This is a concrete instance of a broader class: UI-process handlers that trust a WebContent-supplied FrameIdentifier or PageIdentifier. Narrow: sibling WebPageProxy handlers for other frame-state messages that look up the frame without checking page ownership or sender identity. Wider: the carve-outs are where similar bugs hide in other handlers. "Any process for a parentless subframe" and "parent's provisional process" are states a compromised process may be able to reach by racing a frame detach or a cross-site navigation. Unknown-frame paths that skip validation but still broadcast (as didDestroyFrame does) are worth checking for whether a forged ID can make other processes tear down frames they still host. Ordering: any handler whose correctness depends on when the UI process swaps a frame's process relative to the old process's pagehide/unload messages, as frameNameChanged does. Match tell: webFrameFromID(...) in a message handler with no subsequent comparison against connection's process or frame->page().