Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 91d5f2e2933817cf98eea67665b13fd2405014dc
      
https://github.com/WebKit/WebKit/commit/91d5f2e2933817cf98eea67665b13fd2405014dc
  Author: Sean Patterson <[email protected]>
  Date:   2026-03-20 (Fri, 20 Mar 2026)

  Changed paths:
    M Source/WebCore/page/FocusController.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/FocusWebView.mm

  Log Message:
  -----------
  [Site Isolation] Fix null dereference crash when focus navigates into 
cross-origin iframe containing a nested remote frame
rdar://172564611
https://bugs.webkit.org/show_bug.cgi?id=310307

Reviewed by Megan Gardner.

When findFocusableElementAcrossFocusScope found a candidate with 
ContinuedSearchInRemoteFrame::Yes,
it did not return early, allowing execution to continue into the Remote frame 
owner case with a
null currentNode, causing a crash. Also adds null checks for currentNode and 
currentFrame in the
Remote frame handling path.

* Source/WebCore/page/FocusController.cpp:
(WebCore::FocusController::findFocusableElementAcrossFocusScope): Scope the 
Remote case with
case Frame::FrameType::Remote: { } to satisfy C++ jump-past-initialization 
rules.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/FocusWebView.mm:
(FocusWebView.FocusNavigationIntoFrameWithNestedRemoteFrame): Regression test 
for
rdar://172564611 — site isolation crash when focus navigation enters a 
cross-origin iframe
(Process B) whose document itself begins with a nested cross-origin iframe 
(another RemoteFrame
from Process B's perspective). Previously, findFocusableElementAcrossFocusScope 
found the nested
RemoteFrame as the first candidate (returning { null, 
ContinuedSearchInRemoteFrame::Yes }) but
did not return early, allowing a null dereference of currentNode in the Remote 
owner case.

Canonical link: https://commits.webkit.org/309671@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to