← All reports

Web processes can no longer overwrite UI-computed frame tree sync data

Site isolation's frame-tree sync let renderers vouch for other frames' origins

Component: WebKit Site Isolation | 6209e18

Source/WebKit/UIProcess/WebPageProxy.cpp

+// The UI process sends the remaining properties from its own state, and frame geometry through
+// handleFrameGeometryUpdates, so a web process must not broadcast them.
+static bool LEGACY_NODELETE frameTreePropertyCanBeBroadcastByWebProcess(WebCore::FrameTreeSyncDataType property)
+{
+ switch (property) {
+ case WebCore::FrameTreeSyncDataType::FrameDocumentIsSandboxedOrigin:
+ case WebCore::FrameTreeSyncDataType::FrameRect:
+ return true;
+ case WebCore::FrameTreeSyncDataType::FrameCanCreatePaymentSession:
+ case WebCore::FrameTreeSyncDataType::FrameDocumentSecurityOrigin:
+ case WebCore::FrameTreeSyncDataType::FrameDocumentSecurityPolicy:
+ case WebCore::FrameTreeSyncDataType::FrameURLProtocol:
+ case WebCore::FrameTreeSyncDataType::FrameGeometry:
+ case WebCore::FrameTreeSyncDataType::FrameViewportInfo:
+ return false;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+}

LayoutTests/ipc/broadcast-frame-tree-sync-data-ui-owned-properties.html

+ { name: "FrameCanCreatePaymentSession", variantIndex: 0, variant: true, expectRejected: true },
+ { name: "FrameDocumentSecurityPolicy", variantIndex: 2, variant: { }, expectRejected: true },
+ { name: "FrameDocumentIsSandboxedOrigin", variantIndex: 3, variant: false, expectRejected: false },
+ { name: "FrameURLProtocol", variantIndex: 4, variant: "https", expectRejected: true },

With site isolation, a page's frame tree is spread across several WebContent processes, and each process holds only a proxy (remote frame) for frames it doesn't own. FrameTreeSyncData is the per-frame state the UI process keeps consistent across all of them: security origin and policy, payment-session capability, URL protocol, rect, and so on. The UI process is meant to be the authority for most of these values, and the process that owns a frame is untrusted.

WebPageProxy::broadcastFrameTreeSyncData now relays only FrameDocumentIsSandboxedOrigin and FrameRect from a web process, gated by the new frameTreePropertyCanBeBroadcastByWebProcess() switch. Any other FrameTreeSyncDataType fails the IPC message check and terminates the sender. The never-sent BroadcastAllFrameTreeSyncData message is removed, along with its client plumbing in WebFrameLoaderClient, WebLocalFrameLoaderClient, and WebRemoteFrameClient.

Before:                                         After:
Owning WebContent (compromised)                 Owning WebContent
  └─► BroadcastFrameTreeSyncData(any)             └─► BroadcastFrameTreeSyncData(prop)
  └─► BroadcastAllFrameTreeSyncData(all)                └─► MESSAGE_CHECK(canBeBroadcast)
        └─► UI relays unchecked ──► children                  ├─ SandboxedOrigin, Rect ──► relay
            (fake secure context / payment)                   └─ else ──► sender terminated

A compromised WebContent process could previously make a frame in another process look like a secure context or one allowed to create a payment session. This closes a cross-process trust gap at the core of the site isolation model.

The template generalizes to any web-process-to-UI message that the UI process relays or applies to other processes. Narrow: the remaining carriers of the same data (document sync data messages, handleFrameGeometryUpdates, applyDeferredTopDocumentSyncDataFromCommittedProcess) may have similar gaps, and FrameDocumentSecurityOrigin, FrameGeometry, and FrameViewportInfo are not covered by the new test. Wider: the two still-accepted properties are fully web-process-controlled, so their consumers in other processes (sandbox and origin decisions, hit-testing, geometry, viewport) are worth checking for assumptions of trusted values. Any relay message that accepts a sender-chosen frame ID without confirming the sender owns that frame is the same shape as the frame-validation fix below. Match tell: a UI-process handler that forwards a decoded value to other processes without a MESSAGE_CHECK tying the value or the frame ID to the sender.