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
LayoutTests/ipc/broadcast-frame-tree-sync-data-ui-owned-properties.html
Site isolation 환경에서는 한 page의 frame tree가 여러 WebContent process에 나뉘어 존재합니다. 이때 각 process는 자신이 소유하지 않은 frame에 대해 proxy(remote frame)만 보유합니다. FrameTreeSyncData는 UI process가 이 모든 process 사이에서 일관되게 유지하는 frame 단위 state입니다. Security origin과 policy, payment session 생성 가능 여부, URL protocol, rect 등이 여기에 포함됩니다. 설계상 이 값들 대부분은 UI process가 기준이 되며, frame을 소유한 process는 신뢰할 수 없는 대상으로 취급됩니다.
이번 수정으로 WebPageProxy::broadcastFrameTreeSyncData는 web process가 보낸 값 중 FrameDocumentIsSandboxedOrigin과 FrameRect만 relay하게 되었습니다. 허용 여부는 새로 추가된 frameTreePropertyCanBeBroadcastByWebProcess() switch에서 판단합니다. 그 밖의 FrameTreeSyncDataType은 IPC message check에서 거부되고, 송신한 process는 종료됩니다. 한편 실제로 전송된 적이 없던 BroadcastAllFrameTreeSyncData message는 제거되었습니다. WebFrameLoaderClient, WebLocalFrameLoaderClient, WebRemoteFrameClient에 있던 관련 client 연결 코드도 함께 삭제되었습니다.
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
Significance
패치 이전에는 compromise된 WebContent process가 다른 process의 frame을 secure context처럼, 또는 payment session 생성이 허용된 frame처럼 보이게 만들 수 있었습니다. Site isolation 모델의 핵심에 놓여 있던 cross-process 신뢰 공백이 이번 수정으로 막혔습니다.
Audit directions
같은 패턴은 UI process가 다른 process로 relay하거나 적용하는 모든 web process → UI process message로 일반화할 수 있습니다. Narrow: 같은 데이터를 전달하는 나머지 경로(document sync data message, handleFrameGeometryUpdates, applyDeferredTopDocumentSyncDataFromCommittedProcess)에도 비슷한 공백이 존재할 가능성이 있습니다. 또한 FrameDocumentSecurityOrigin, FrameGeometry, FrameViewportInfo는 새 test에서 다루지 않습니다. Wider: 여전히 허용되는 두 property는 전적으로 web process가 제어하는 값입니다. 따라서 다른 process에서 이 값을 사용하는 쪽(sandbox 및 origin 판단, hit-testing, geometry, viewport)이 신뢰된 값을 전제로 동작하는지 점검할 필요가 있습니다. 송신자가 지정한 frame ID를 받으면서 그 frame을 송신자가 실제로 소유하는지 확인하지 않는 relay message도 살펴볼 만합니다. 아래에서 다루는 frame 검증 fix와 같은 형태이기 때문입니다. Match tell: decode한 값을 다른 process로 전달하면서, 그 값이나 frame ID를 송신자와 연결해 검증하는 MESSAGE_CHECK가 없는 UI process handler.