Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 397d4fbfa071a0bc084279c5a06644d4b8f68fcc
https://github.com/WebKit/WebKit/commit/397d4fbfa071a0bc084279c5a06644d4b8f68fcc
Author: Charlie Wolfe <[email protected]>
Date: 2026-09-22 (Tue, 22 Sep 2026)
Changed paths:
A
LayoutTests/http/tests/resourceLoadStatistics/block-cookies-on-cross-site-media-redirect.https-expected.txt
A
LayoutTests/http/tests/resourceLoadStatistics/block-cookies-on-cross-site-media-redirect.https.html
A
LayoutTests/http/tests/resourceLoadStatistics/resources/cross-site-media-redirect.py
M Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
M Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
M Source/WebKit/NetworkProcess/cocoa/NetworkTaskCocoa.h
M Source/WebKit/NetworkProcess/cocoa/NetworkTaskCocoa.mm
Log Message:
-----------
Unpartitioned cookies are sent on a cross-site redirect when cookie
partitioning is enabled
https://bugs.webkit.org/show_bug.cgi?id=319916
rdar://181913390
Reviewed by Matthew Finkel.
With CHIPS enabled, a third-party request is sent with only partitioned cookies
via the private
NSURLRequest property _allowOnlyPartitionedCookies, set by the network process.
On an HTTP redirect
the delegate rebuilds the NSURLRequest from the WebCore::ResourceRequest after
mutating it (e.g.
restrictRequestReferrerToOriginIfNeeded()), which drops the flag because it is
a per-NSURLRequest
property that is not carried on ResourceRequest. The redirected request is then
no longer restricted
to partitioned cookies, so unpartitioned cookies are sent to the third party.
Test:
http/tests/resourceLoadStatistics/block-cookies-on-cross-site-media-redirect.https.html
This bug is specific to media redirects with CHIPS enabled.
*
LayoutTests/http/tests/resourceLoadStatistics/block-cookies-on-cross-site-media-redirect.https-expected.txt:
Added.
*
LayoutTests/http/tests/resourceLoadStatistics/block-cookies-on-cross-site-media-redirect.https.html:
Added.
*
LayoutTests/http/tests/resourceLoadStatistics/resources/cross-site-media-redirect.py:
Added.
* Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate
URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
* Source/WebKit/NetworkProcess/cocoa/NetworkTaskCocoa.h:
(WebKit::NetworkTaskCocoa::hasBeenSetToAllowOnlyPartitionedCookies const):
* Source/WebKit/NetworkProcess/cocoa/NetworkTaskCocoa.mm:
(WebKit::NetworkTaskCocoa::willPerformHTTPRedirection):
(WebKit::NetworkTaskCocoa::shouldAllowOnlyPartitionedCookies):
Originally-landed-as: 316606.238@safari-7625-branch (93576dcf7c39).
rdar://187506836
Canonical link: https://commits.webkit.org/321640@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications