Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 43701fcf3eede83baf3a124ad8359677ba3619e7
      
https://github.com/WebKit/WebKit/commit/43701fcf3eede83baf3a124ad8359677ba3619e7
  Author: Sihui Liu <[email protected]>
  Date:   2026-07-24 (Fri, 24 Jul 2026)

  Changed paths:
    M Source/WebCore/Modules/fetch/IPAddressSpace.cpp
    M Source/WebCore/Modules/fetch/IPAddressSpace.h
    M Source/WebKit/UIProcess/BrowsingContextGroup.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/IPAddressSpaceTests.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

  Log Message:
  -----------
  [Site Isolation] Loopback/local-network sites should not enter shared process
https://bugs.webkit.org/show_bug.cgi?id=320135
rdar://183071225

Reviewed by Ryosuke Niwa.

Site Isolation's shared process mode puts multiple cross-site frames into one 
WebProcess for performance, trading away
some of the process-boundary protection between the co-located sites. 
Loopback/local-network endpoints (routers,
printers, NAS boxes, local dev servers) often expose sensitive data or 
privileged functionality behind weak or no
authentication, so colocating them with an arbitrary other site's renderer 
increases the blast radius of a renderer
compromise. Therefore, exclude them from the shared process pool.

BrowsingContextGroup::sharedProcessForSite now bails out for any site whose 
host is a loopback/local-network IP literal
or a literal localhost/*.localhost.

Also, Added a WebCore::Site overload of determineIPAddressSpace() so the check 
can classify a Site the same way the
existing URL overload classifies a URL.

Test: TestWebKitAPI.IPAddressSpace
      TestWebKitAPI.SiteIsolation.SharedProcessExcludesLoopback

* Source/WebCore/Modules/fetch/IPAddressSpace.cpp:
(WebCore::determineIPAddressSpaceFromHost):
(WebCore::determineIPAddressSpace):
* Source/WebCore/Modules/fetch/IPAddressSpace.h:
* Source/WebKit/UIProcess/BrowsingContextGroup.cpp:
(WebKit::isLoopbackOrLocalNetworkSite):
(WebKit::BrowsingContextGroup::sharedProcessForSite):
* Tools/TestWebKitAPI/Tests/WebCore/IPAddressSpaceTests.cpp:
(TestWebKitAPI::TEST(IPAddressSpace, SiteMatchesURLForIPLiterals)):
(TestWebKitAPI::TEST(IPAddressSpace, SiteDoesNotSpecialCaseLocalhostName)):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::(SiteIsolation, SharedProcessExcludesLoopback)):

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



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

Reply via email to