Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ea7d159a45e544d013234dec9c56760129dcc8c0
      
https://github.com/WebKit/WebKit/commit/ea7d159a45e544d013234dec9c56760129dcc8c0
  Author: Ronan Turner <[email protected]>
  Date:   2026-02-05 (Thu, 05 Feb 2026)

  Changed paths:
    M Source/WebCore/loader/DocumentLoader.cpp
    M Source/WebCore/loader/DocumentLoader.h
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/cache/CachedResourceLoader.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/EnhancedSecurityPolicies.mm

  Log Message:
  -----------
  Fix ContentRuleList HTTPS upgrade behaviour with Enhanced Security
https://bugs.webkit.org/show_bug.cgi?id=305379
rdar://168058731

Reviewed by Matthew Finkel.

When the Enhanced Security heuristics flag is enabled by default, a test
failure occurred in:

  * WebKit.RedirectToPlaintextHTTPSUpgrade

This test ensures that a HTTPS site performing a same-site redirect to
plaintext HTTP does not get upgraded by the ContentRuleList rules, as this
is an explicit HTTP redirect.

When the Enhanced Security heuristics flag is enabled, the redirect to the
HTTP site causes us to process swap and load this in an Enhanced Security
process. In doing so, we change the load code path taken and lost information
that this explicit redirect had occurred.

To address this, this change explicitly checks for us having continued the
load due to a navigation policy change, and uses the original request URL,
if different, when processing the ContentRuleList for this load.

We also now have an explicit test that checks this case.

Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/EnhancedSecurityPolicies.mm

* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::clearMainResourceLoader):
(WebCore::DocumentLoader::clearMainResource):
* Source/WebCore/loader/DocumentLoader.h:
(WebCore::DocumentLoader::isContinuingLoadAfterProvisionalLoadStarted const):
(WebCore::DocumentLoader::isContinuingLoadAfterNavigationPolicyDecision const):
(WebCore::DocumentLoader::setIsContinuingLoad):
(WebCore::DocumentLoader::setIsContinuingLoadAfterProvisionalLoadStarted): 
Deleted.
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithNavigationAction):
* Source/WebCore/loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/EnhancedSecurityPolicies.mm:
(runHttpsToSameSiteHttpExplicitRedirect):

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



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

Reply via email to