[Page Loading] Network process crashes when downloading a cross-origin target=_blank link#69422
Open
basuke wants to merge 1 commit into
Open
[Page Loading] Network process crashes when downloading a cross-origin target=_blank link#69422basuke wants to merge 1 commit into
basuke wants to merge 1 commit into
Conversation
…n target=_blank link https://bugs.webkit.org/show_bug.cgi?id=319427 rdar://182181803 Reviewed by NOBODY (OOPS!). Option-clicking a cross-origin link with target="_blank" (for example the "Full logs" link on an ews-build.webkit.org results page, which points to an S3 URL) reliably terminates the Network process. PolicyChecker::checkNewWindowPolicy() handles new-window (target="_blank") navigations. Its PolicyAction::Download case called FrameLoaderClient::startDownload() without first calling FrameLoader::setOriginalURLForDownloadRequest(), unlike the same-frame path in checkNavigationPolicy(). As a result the download request kept the firstPartyForCookies that FrameLoader sets for a willOpenInNewWindow main-resource load, which is the destination URL itself (the cross-origin URL). The StartDownload IPC is then sent from the source page's web process, whose allowed-first-parties set only contains the source site, so the CSRF first-party-for-cookies MESSAGE_CHECK in NetworkConnectionToWebProcess::startDownload() rejected the message and terminated the process. Call setOriginalURLForDownloadRequest() in checkNewWindowPolicy()'s download case, matching checkNavigationPolicy(). Because m_frame is the source frame, firstPartyForCookies becomes the originating page, which is in the process's allowed set. * Source/WebCore/loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNewWindowPolicy): * Tools/TestWebKitAPI/Tests/WebKit/WKWebView/Download.mm: (TestWebKitAPI::TEST): Added CrossSiteTargetBlankDownloadDoesNotCrashNetworkProcess. * Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm: (TestWebKitAPI::TEST): Added CrossSiteTargetBlankDownloadDoesNotCrashNetworkProcess.
Collaborator
|
EWS run on current version of this PR (hash c57019a) Details
|
cdumez
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧪 api-ios
c57019a
c57019a