Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 66d43bea8153d9b8fd36876a06fcf2bd15e6f902
https://github.com/WebKit/WebKit/commit/66d43bea8153d9b8fd36876a06fcf2bd15e6f902
Author: Ian Gower <[email protected]>
Date: 2026-09-04 (Fri, 04 Sep 2026)
Changed paths:
M Source/WebCore/loader/DocumentLoader.cpp
M Source/WebCore/loader/DocumentThreadableLoader.cpp
M Source/WebCore/loader/MixedContentChecker.cpp
M Source/WebCore/loader/MixedContentChecker.h
M Source/WebCore/loader/cache/CachedResourceLoader.cpp
M Source/WebCore/loader/cache/CachedResourceLoader.h
M Tools/TestWebKitAPI/Tests/WebCore/MixedContentChecker.cpp
Log Message:
-----------
Revised Mixed Content rules to match LNA spec
https://bugs.webkit.org/show_bug.cgi?id=297739
rdar://154439054
Reviewed by Brent Fulgham.
Feature work for Local Network Access
(https://wicg.github.io/local-network-access/).
Section 3.2
(https://wicg.github.io/local-network-access/#integration-with-mixed-content)
amends both mixed-content algorithms so a request whose target IP address space
is local is
neither upgraded nor blocked. Without it an https page can never reach a local
device over
http, and the Local Network Access permission never gets the chance to decide.
Only fetch() sets a target address space on its request, so MixedContentChecker
derives one
from the URL for every other load, and CachedResourceLoader and
DocumentThreadableLoader thread
the request's declared value through to it. Deriving from the URL covers IP
literals and .local
names; a hostname that resolves to a private address still reads as public and
stays blocked,
since no peer address exists this early in the load. The derivation is gated on
the
LocalNetworkAccess setting, so with the feature off nothing escapes an upgrade
or block that did
not already.
This exempts loopback as well as local, where the spec exempts only local.
Section 3.1.1
leaves loopback out on the grounds that a loopback URL is already potentially
trustworthy and
so never reaches these checks; exempting it explicitly means the rule does not
depend on that
holding.
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
* Source/WebCore/loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* Source/WebCore/loader/MixedContentChecker.cpp:
(WebCore::effectiveTargetAddressSpace):
(WebCore::MixedContentChecker::shouldUpgradeInsecureContent):
(WebCore::MixedContentChecker::canModifyRequest):
(WebCore::MixedContentChecker::shouldBlockRequest):
* Source/WebCore/loader/MixedContentChecker.h:
* Source/WebCore/loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::checkInsecureContent const):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::canRequestAfterRedirection const):
(WebCore::CachedResourceLoader::updateRequestAfterRedirection):
(WebCore::CachedResourceLoader::requestResource):
* Source/WebCore/loader/cache/CachedResourceLoader.h:
* Tools/TestWebKitAPI/Tests/WebCore/MixedContentChecker.cpp:
Canonical link: https://commits.webkit.org/320538@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications