← All reports

[Site Isolation] Find-in-page scroll propagation through cross-site iframes

Component: WebKit Site Isolation | ab06c21

Source/WebKit/UIProcess/WebFrameProxy.cpp

+void WebFrameProxy::scrollRectToVisibleContinuingFromFrame(WebCore::FrameIdentifier childFrameID, const WebCore::IntRect& rectInChildFrameView, const WebCore::ScrollRectToVisibleOptions& options)
+{
+ RefPtr childFrame = WebFrameProxy::webFrame(childFrameID);
+ if (!childFrame || childFrame->parentFrame() != this)
+ return;
+ send(Messages::WebFrame::ScrollRectToVisibleContinuingFromFrame(childFrameID, rectInChildFrameView, options));
+}

Source/WebCore/page/LocalFrameView.cpp

+void LocalFrameView::scrollRectToVisibleContinuingFromChildFrame(Frame& childFrame, const IntRect& rectInChildFrameView, const ScrollRectToVisibleOptions& options)
+{
+ if (childFrame.tree().parent() != m_frame.ptr())
+ return;
+ ...
+ auto rectInContents = viewToContents(childView->convertToContainingView(rectInChildFrameView));
+ scrollRectToVisible(rectInContents, *ownerRenderer, false /* insideFixed */, options);
+}

FrameSelection::revealSelection() normally reveals a target by walking up through each <iframe> owner renderer, but a cross-site child under site isolation has no owner element in its own process, so the walk stopped at the child. Now, when a child's parent is a RemoteFrame, the child sends the rect (in its view coordinates) and a newly serialized ScrollRectToVisibleOptions to WebFrameProxy. The UI process checks that the named child's parent is the target proxy and forwards the request to the parent process. The parent converts the rect and scrolls from the owner renderer, and the relay repeats up to the main frame.

Find-in-page matches inside cross-site iframes now scroll the embedding page, at the cost of a new WebContent-to-UI-to-WebContent relay carrying renderer-controlled geometry and scroll options.

The UI-process check only confirms that childFrameID's parent is this proxy; it does not confirm the connection belongs to the process hosting that child, so a compromised process could name a sibling's frame ID. Look at how scrollRectToVisibleContinuingFromChildFrame() re-checks the relationship when frames detach, reparent, or move between processes mid-flight. Probe convertToContainingView(), viewToContents() and LayoutUnit conversions with extreme rects, and the new ScrollTypes.serialization.in entries for unchecked enums or optionals. scrollRectToVisible() can trigger layout and scroll events, so verify the owner element, the CheckedPtr renderer and the child view stay valid. The refactored scrollRectToVisibleInChildView() now accepts a null ownerElement, so confirm nothing else dereferences it unconditionally. Multi-hop propagation is asynchronous per hop, which opens questions about frame-tree changes between hops and message amplification.