Changeset 280953 in webkit
- Timestamp:
- Aug 11, 2021 7:43:53 PM (11 months ago)
- Location:
- trunk
- Files:
-
- 4 added
- 2 deleted
- 91 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (4 diffs)
-
LayoutTests/http/wpt/html/cross-origin-embedder-policy (added)
-
LayoutTests/http/wpt/html/cross-origin-embedder-policy/require-corp.https-expected.txt (added)
-
LayoutTests/http/wpt/html/cross-origin-embedder-policy/require-corp.https.html (added)
-
LayoutTests/http/wpt/html/cross-origin-embedder-policy/require-corp.https.html.headers (added)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/coep-frame-javascript.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/iframe-coep-require-corp.tentative.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/data.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/javascript.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/multi-globals/workers-coep-report.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/no-secure-context-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none-sw-from-require-corp.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank-expected.txt (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc-expected.txt (deleted)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-load-from-cache-storage.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-none.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-require-corp.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp.https-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/sandbox.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/service-worker-cache-storage.https-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/srcdoc.https-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk1/TestExpectations (modified) (2 diffs)
-
LayoutTests/platform/win/TestExpectations (modified) (2 diffs)
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/cache/DOMCache.cpp (modified) (1 diff)
-
Source/WebCore/Modules/cache/DOMCacheEngine.cpp (modified) (2 diffs)
-
Source/WebCore/Modules/cache/DOMCacheEngine.h (modified) (3 diffs)
-
Source/WebCore/Modules/cache/RetrieveRecordsOptions.h (modified) (5 diffs)
-
Source/WebCore/dom/Document.cpp (modified) (1 diff)
-
Source/WebCore/dom/SecurityContext.h (modified) (3 diffs)
-
Source/WebCore/loader/CrossOriginAccessControl.cpp (modified) (3 diffs)
-
Source/WebCore/loader/CrossOriginAccessControl.h (modified) (2 diffs)
-
Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp (modified) (3 diffs)
-
Source/WebCore/loader/CrossOriginEmbedderPolicy.h (modified) (1 diff)
-
Source/WebCore/loader/CrossOriginOpenerPolicy.cpp (modified) (1 diff)
-
Source/WebCore/loader/DocumentThreadableLoader.cpp (modified) (7 diffs)
-
Source/WebCore/loader/DocumentThreadableLoader.h (modified) (4 diffs)
-
Source/WebCore/loader/DocumentWriter.cpp (modified) (2 diffs)
-
Source/WebCore/loader/FrameLoader.cpp (modified) (2 diffs)
-
Source/WebCore/loader/ResourceLoaderOptions.h (modified) (2 diffs)
-
Source/WebCore/loader/WorkerThreadableLoader.cpp (modified) (3 diffs)
-
Source/WebCore/loader/cache/CachedResourceLoader.cpp (modified) (1 diff)
-
Source/WebCore/page/SecurityOrigin.h (modified) (1 diff)
-
Source/WebCore/platform/network/HTTPParsers.cpp (modified) (1 diff)
-
Source/WebCore/platform/network/HTTPParsers.h (modified) (1 diff)
-
Source/WebCore/workers/Worker.cpp (modified) (1 diff)
-
Source/WebCore/workers/WorkerGlobalScope.cpp (modified) (1 diff)
-
Source/WebCore/workers/WorkerGlobalScopeProxy.h (modified) (1 diff)
-
Source/WebCore/workers/WorkerMessagingProxy.cpp (modified) (2 diffs)
-
Source/WebCore/workers/WorkerMessagingProxy.h (modified) (1 diff)
-
Source/WebCore/workers/WorkerScriptLoader.cpp (modified) (3 diffs)
-
Source/WebCore/workers/WorkerScriptLoader.h (modified) (3 diffs)
-
Source/WebCore/workers/WorkerThread.cpp (modified) (1 diff)
-
Source/WebCore/workers/WorkerThread.h (modified) (2 diffs)
-
Source/WebCore/workers/service/ServiceWorkerContainer.cpp (modified) (2 diffs)
-
Source/WebCore/workers/service/ServiceWorkerContainer.h (modified) (1 diff)
-
Source/WebCore/workers/service/ServiceWorkerContextData.cpp (modified) (1 diff)
-
Source/WebCore/workers/service/ServiceWorkerContextData.h (modified) (5 diffs)
-
Source/WebCore/workers/service/ServiceWorkerFetchResult.h (modified) (5 diffs)
-
Source/WebCore/workers/service/ServiceWorkerJob.cpp (modified) (1 diff)
-
Source/WebCore/workers/service/ServiceWorkerJobClient.h (modified) (2 diffs)
-
Source/WebCore/workers/service/context/ServiceWorkerThread.cpp (modified) (1 diff)
-
Source/WebCore/workers/service/server/RegistrationDatabase.cpp (modified) (8 diffs)
-
Source/WebCore/workers/service/server/SWServer.cpp (modified) (3 diffs)
-
Source/WebCore/workers/service/server/SWServer.h (modified) (1 diff)
-
Source/WebCore/workers/service/server/SWServerJobQueue.cpp (modified) (1 diff)
-
Source/WebCore/workers/service/server/SWServerWorker.cpp (modified) (3 diffs)
-
Source/WebCore/workers/service/server/SWServerWorker.h (modified) (3 diffs)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp (modified) (4 diffs)
-
Source/WebKit/NetworkProcess/NetworkLoadChecker.h (modified) (4 diffs)
-
Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp (modified) (3 diffs)
-
Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h (modified) (3 diffs)
-
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (modified) (4 diffs)
-
Source/WebKit/NetworkProcess/NetworkResourceLoader.h (modified) (1 diff)
-
Source/WebKit/NetworkProcess/PingLoad.cpp (modified) (3 diffs)
-
Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp (modified) (1 diff)
-
Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp (modified) (2 diffs)
-
Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h (modified) (2 diffs)
-
Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp (modified) (2 diffs)
-
Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp (modified) (3 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280948 r280953 1 2021-08-11 Chris Dumez <cdumez@apple.com> 2 3 Add initial support for Cross-Origin-Embedder-Policy (COEP) 4 https://bugs.webkit.org/show_bug.cgi?id=228754 5 6 Reviewed by Alex Christensen. 7 8 Update test expectations now that we support COEP on WK2. 9 10 * TestExpectations: 11 * http/wpt/html/cross-origin-embedder-policy/require-corp.https-expected.txt: Added. 12 * http/wpt/html/cross-origin-embedder-policy/require-corp.https.html: Added. 13 * http/wpt/html/cross-origin-embedder-policy/require-corp.https.html.headers: Added. 14 * platform/mac-wk1/TestExpectations: 15 * platform/win/TestExpectations: 16 1 17 2021-08-11 Jean-Yves Avenard <jya@apple.com> 2 18 -
trunk/LayoutTests/TestExpectations
r280928 r280953 395 395 396 396 # Console log lines may appear in a different order so we silence them. 397 http/wpt/html/cross-origin-embedder-policy/require-corp.https.html [ DumpJSConsoleLogInStdErr ] 397 398 imported/w3c/web-platform-tests/eventsource/format-utf-8.htm [ DumpJSConsoleLogInStdErr ] 398 399 imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html [ DumpJSConsoleLogInStdErr Failure Pass ] … … 530 531 imported/w3c/web-platform-tests/html/browsers/sandboxing/window-open-blank-from-different-initiator.html [ Skip ] 531 532 imported/w3c/web-platform-tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html [ Skip ] 532 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-service-worker.https.html [ Skip ]533 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/shared-worker.tentative.https.html [ Skip ]534 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker.https.html [ Skip ]535 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https.html [ Skip ]536 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-frame-owner.https.html [ Skip ]537 533 imported/w3c/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html [ Skip ] 538 534 imported/w3c/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html [ Skip ] … … 717 713 imported/w3c/web-platform-tests/html/cross-origin-opener-policy/reporting [ Skip ] 718 714 719 # This test is timing out locally but passing on wpt.live. The issue is that we run the WPT tests over localhost and they 720 # are thus marked as secure contexts even when served over HTTP. The test assumes the context is non-secure because the 721 # test is served over HTTP. 715 # Cross-Origin-Embedder-Policy: credentialless is not supported. 716 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless 717 718 # These tests are timing out locally but passing on wpt.live. The issue is that we run the WPT tests over localhost and they 719 # are thus marked as secure contexts even when served over HTTP. These tests assume the context is non-secure because they 720 # are served over HTTP. 722 721 imported/w3c/web-platform-tests/html/cross-origin-opener-policy/no-https.html [ Skip ] 722 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/no-secure-context.html [ Skip ] 723 724 # COEP test timing out due to lack of Blob URL support. 725 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https.html [ Skip ] 726 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html [ Skip ] 727 imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https.html [ Skip ] 728 729 # This test makes the assumption that get_host_info().REMOTE_ORIGIN is same-site, which is not true for 730 # our layout tests. We maintain our own version of this test in http/wpt. 731 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp.https.html [ Skip ] 732 733 # We do not support COEP reporting. 734 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https.html [ Failure Pass ] 735 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/multi-globals/workers-coep-report.https.html [ Skip ] 723 736 724 737 # Newly imported WPT tests that are crashing. … … 775 788 imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/microtasks/checkpoint-after-window-onerror-module.html [ Failure Pass ] 776 789 imported/w3c/web-platform-tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.html [ Failure Pass ] 777 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/iframe-coep-credentialless.tentative.https.html [ Failure Pass ]778 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/iframe-coep-require-corp.tentative.https.html [ Failure Pass ]779 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/image.tentative.https.html [ Failure Pass ]780 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https.html [ Failure Pass ]781 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https.html [ Failure Pass ]782 790 imported/w3c/web-platform-tests/html/webappapis/update-rendering/child-document-raf-order.html [ Failure Pass ] 783 791 imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-lazy.tentative.html [ Failure Pass ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r280933 r280953 1 2021-08-11 Chris Dumez <cdumez@apple.com> 2 3 Add initial support for Cross-Origin-Embedder-Policy (COEP) 4 https://bugs.webkit.org/show_bug.cgi?id=228754 5 6 Reviewed by Alex Christensen. 7 8 Rebaseline COEP WPT tests now that we are passing more checks. 9 10 * web-platform-tests/html/cross-origin-embedder-policy/blob.https-expected.txt: 11 * web-platform-tests/html/cross-origin-embedder-policy/coep-frame-javascript.https-expected.txt: 12 * web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt: 13 * web-platform-tests/html/cross-origin-embedder-policy/credentialless/iframe-coep-require-corp.tentative.https-expected.txt: 14 * web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt: 15 * web-platform-tests/html/cross-origin-embedder-policy/data.https-expected.txt: 16 * web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https-expected.txt: 17 * web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker.https-expected.txt: 18 * web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https-expected.txt: 19 * web-platform-tests/html/cross-origin-embedder-policy/javascript.https-expected.txt: 20 * web-platform-tests/html/cross-origin-embedder-policy/multi-globals/workers-coep-report.https-expected.txt: 21 * web-platform-tests/html/cross-origin-embedder-policy/no-secure-context-expected.txt: 22 * web-platform-tests/html/cross-origin-embedder-policy/none-sw-from-require-corp.https-expected.txt: 23 * web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt: 24 * web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https-expected.txt: 25 * web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank-expected.txt: Removed. 26 * web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank.https-expected.txt: 27 * web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc-expected.txt: Removed. 28 * web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc.https-expected.txt: 29 * web-platform-tests/html/cross-origin-embedder-policy/require-corp-load-from-cache-storage.https-expected.txt: 30 * web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-none.https-expected.txt: 31 * web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-require-corp.https-expected.txt: 32 * web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw.https-expected.txt: 33 * web-platform-tests/html/cross-origin-embedder-policy/require-corp.https-expected.txt: 34 * web-platform-tests/html/cross-origin-embedder-policy/sandbox.https-expected.txt: 35 * web-platform-tests/html/cross-origin-embedder-policy/service-worker-cache-storage.https-expected.txt: 36 * web-platform-tests/html/cross-origin-embedder-policy/srcdoc.https-expected.txt: 37 1 38 2021-08-11 Chris Dumez <cdumez@apple.com> 2 39 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/blob.https-expected.txt
r267646 r280953 1 CONSOLE MESSAGE: Refused to display 'blob:https://localhost:9443/ce752f78-9f54-4192-885f-d338222dbf89' in a frame because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Refused to display 'blob:https://127.0.0.1:9443/2d609484-fc8c-4162-b451-5e5a60ca6fb0' in a frame because of Cross-Origin-Embedder-Policy. 3 CONSOLE MESSAGE: Refused to display 'blob:https://127.0.0.1:9443/d6c69b1b-b9e2-468f-afd5-3ee0ca1f26cd' in a frame because of Cross-Origin-Embedder-Policy. 4 CONSOLE MESSAGE: Refused to display 'blob:https://localhost:9443/a2f48f74-c115-4535-8945-845540d08260' in a frame because of Cross-Origin-Embedder-Policy. 5 CONSOLE MESSAGE: Refused to display 'blob:https://127.0.0.1:9443/e46352d8-4f39-4348-addc-cf3be4c271d5' in a frame because of Cross-Origin-Embedder-Policy. 6 CONSOLE MESSAGE: Refused to display 'blob:https://127.0.0.1:9443/d4b68c8b-e74e-47a5-a08d-612bf0d709d7' in a frame because of Cross-Origin-Embedder-Policy. 1 7 2 Harness Error ( FAIL), message = 2 duplicate test names: "Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via subframe", "Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via navigate"8 Harness Error (TIMEOUT), message = null 3 9 4 FAIL Cross-Origin-Embedder-Policy and blob: URL from https://localhost:9443 in subframe via subframe assert_true: Cross-origin without CORP did not fail expected true got false 5 PASS Cross-Origin-Embedder-Policy and blob: URL from https://localhost:9443 in subframe via navigate 6 PASS Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via subframe 7 PASS Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via navigate 8 PASS Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via subframe 9 PASS Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via navigate 10 TIMEOUT Cross-Origin-Embedder-Policy and blob: URL from https://localhost:9443 in subframe via subframe Test timed out 11 TIMEOUT Cross-Origin-Embedder-Policy and blob: URL from https://localhost:9443 in subframe via navigate Test timed out 12 TIMEOUT Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via subframe Test timed out 13 TIMEOUT Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via navigate Test timed out 14 TIMEOUT Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via subframe Test timed out 15 TIMEOUT Cross-Origin-Embedder-Policy and blob: URL from https://127.0.0.1:9443 in subframe via navigate Test timed out 10 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/coep-frame-javascript.https-expected.txt
r264117 r280953 1 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks. 1 3 2 FAIL Cross-Origin-Embedder-Policy frame and javascript: URLs assert_true: Cross-origin without CORP did not fail expected true got false 4 PASS Cross-Origin-Embedder-Policy frame and javascript: URLs 3 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt
r269227 r280953 1 1 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt because it violates the resource's Cross-Origin-Resource-Policy response header. 2 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt. 3 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 4 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks. 3 5 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough because it violates the resource's Cross-Origin-Resource-Policy response header. 4 6 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough due to access control checks. 7 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html?passthrough because it violates the resource's Cross-Origin-Resource-Policy response header. 8 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html?passthrough due to access control checks. 5 9 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin. 6 10 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html. … … 11 15 PASS making a same-origin request for CORP: cross-origin 12 16 PASS making a cross-origin request for CORP: same-origin 13 FAIL making a cross-origin request for no CORP assert_unreached: Should have rejected: undefined Reached unreachable code 17 PASS making a cross-origin request for no CORP 14 18 PASS making a cross-origin request for CORP: cross-origin 15 19 PASS making a cross-origin request for CORP: same-origin [PASS THROUGH] 16 FAIL making a cross-origin request for no CORP [PASS THROUGH] assert_unreached: Should have rejected: undefined Reached unreachable code 20 PASS making a cross-origin request for no CORP [PASS THROUGH] 17 21 PASS making a cross-origin request for CORP: cross-origin [PASS THROUGH] 18 22 PASS making a cross-origin request with CORS without ACAO -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/iframe-coep-require-corp.tentative.https-expected.txt
r279427 r280953 1 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,none)&uuid=48c5cd5d-1a04-4b22-b367-348626e3e72f' in a frame because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Refused to display 'https://127.0.0.1:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,none)&uuid=dc38ab59-60a5-4ca7-846e-07f347cbb88b' in a frame because of Cross-Origin-Embedder-Policy. 3 CONSOLE MESSAGE: Refused to display 'https://127.0.0.1:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,credentialless)&uuid=3bc9c936-138c-44a8-b89a-22d5348db081' in a frame because of Cross-Origin-Embedder-Policy. 4 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,require-corp)&uuid=9b4fc8a0-7c1b-4ced-9055-368e754dc376 because it violates the resource's Cross-Origin-Resource-Policy response header. 5 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,credentialless)&uuid=7f8abf5e-9254-4d23-b288-ed44441c26aa' in a frame because of Cross-Origin-Embedder-Policy. 6 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,none)|header(Cross-Origin-Resource-Policy,cross-origin)&uuid=9bda0fd6-29fb-4c8f-acf4-04b6db9ebf7f' in a frame because of Cross-Origin-Embedder-Policy. 7 CONSOLE MESSAGE: Refused to display 'https://127.0.0.1:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,none)|header(Cross-Origin-Resource-Policy,cross-origin)&uuid=14602c93-2124-4abb-9de9-5f98cb106608' in a frame because of Cross-Origin-Embedder-Policy. 8 CONSOLE MESSAGE: Refused to display 'https://127.0.0.1:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,credentialless)|header(Cross-Origin-Resource-Policy,cross-origin)&uuid=c90ebc7d-77ed-486d-8b4f-5af18771d6f2' in a frame because of Cross-Origin-Embedder-Policy. 9 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/html/cross-origin-embedder-policy/credentialless/resources/executor.html?pipe=|header(Cross-Origin-Embedder-Policy,credentialless)|header(Cross-Origin-Resource-Policy,cross-origin)&uuid=95a65629-9a80-4aa5-81fc-ae7e7d8c2d52' in a frame because of Cross-Origin-Embedder-Policy. 1 10 2 FAIL COEP:require-corp embeds same-origin COEP:none assert_equals: expected "block" but got "load" 3 FAIL COEP:require-corp embeds cross-origin COEP:none assert_equals: expected "block" but got "load" 4 PASS COEP:require-corp embeds same-origin COEP:credentialless 5 FAIL COEP:require-corp embeds cross-origin COEP:credentialless assert_equals: expected "block" but got "load" 11 Harness Error (TIMEOUT), message = null 12 13 PASS COEP:require-corp embeds same-origin COEP:none 14 PASS COEP:require-corp embeds cross-origin COEP:none 15 TIMEOUT COEP:require-corp embeds same-origin COEP:credentialless Test timed out 16 PASS COEP:require-corp embeds cross-origin COEP:credentialless 6 17 PASS COEP:require-corp embeds same-origin COEP:require-corp 7 FAIL COEP:require-corp embeds cross-origin COEP:require-corp assert_equals: expected "block" but got "load" 8 FAIL COEP:require-corp embeds same-origin COEP:none, CORP:cross-origin assert_equals: expected "block" but got "load" 9 FAIL COEP:require-corp embeds cross-origin COEP:none, CORP:cross-origin assert_equals: expected "block" but got "load" 10 PASS COEP:require-corp embeds same-origin COEP:credentialless, CORP:cross-origin 11 PASS COEP:require-corp embeds cross-origin COEP:credentialless, CORP:cross-origin 18 PASS COEP:require-corp embeds cross-origin COEP:require-corp 19 PASS COEP:require-corp embeds same-origin COEP:none, CORP:cross-origin 20 PASS COEP:require-corp embeds cross-origin COEP:none, CORP:cross-origin 21 TIMEOUT COEP:require-corp embeds same-origin COEP:credentialless, CORP:cross-origin Test timed out 22 TIMEOUT COEP:require-corp embeds cross-origin COEP:credentialless, CORP:cross-origin Test timed out 12 23 PASS COEP:require-corp embeds same-origin COEP:require-corp, CORP:cross-origin 13 24 PASS COEP:require-corp embeds cross-origin COEP:require-corp, CORP:cross-origin -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt
r280504 r280953 1 CONSOLE MESSAGE: Refused to load 'blob:https://localhost:9443/0626116e-3414-4f35-bd1e-007f1312b79e' worker because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 3 CONSOLE MESSAGE: Cannot load blob:https://localhost:9443/0626116e-3414-4f35-bd1e-007f1312b79e due to access control checks. 4 CONSOLE MESSAGE: Refused to load 'blob:https://localhost:9443/a99eb341-4640-403a-a8f4-c2fcf28ede20' worker because of Cross-Origin-Embedder-Policy. 5 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 6 CONSOLE MESSAGE: Cannot load blob:https://localhost:9443/a99eb341-4640-403a-a8f4-c2fcf28ede20 due to access control checks. 7 CONSOLE MESSAGE: Refused to load 'blob:https://localhost:9443/929d633e-ce48-43ff-b89d-e4e20fca6753' worker because of Cross-Origin-Embedder-Policy. 8 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 9 CONSOLE MESSAGE: Cannot load blob:https://localhost:9443/929d633e-ce48-43ff-b89d-e4e20fca6753 due to access control checks. 10 CONSOLE MESSAGE: Refused to load 'blob:https://localhost:9443/0c8b6914-58db-417c-9e0c-e7ecacc4a16a' worker because of Cross-Origin-Embedder-Policy. 11 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 12 CONSOLE MESSAGE: Cannot load blob:https://localhost:9443/0c8b6914-58db-417c-9e0c-e7ecacc4a16a due to access control checks. 13 14 15 Harness Error (TIMEOUT), message = null 1 16 2 17 FAIL frame: origin = https://localhost:9443, value = undefined assert_equals: expected true but got false … … 16 31 PASS dedicated worker: scheme = data, value = self 17 32 PASS dedicated worker: scheme = data, value = (\) 18 FAIL dedicated worker: scheme = blob, value = undefined assert_equals: expected true but got false 19 FAIL dedicated worker: scheme = blob, value = * assert_equals: expected true but got false 20 FAIL dedicated worker: scheme = blob, value = self assert_equals: expected true but got false 21 PASS dedicated worker: scheme = blob, value = (\) 33 TIMEOUT dedicated worker: scheme = blob, value = undefined Test timed out 34 TIMEOUT dedicated worker: scheme = blob, value = * Test timed out 35 TIMEOUT dedicated worker: scheme = blob, value = self Test timed out 36 TIMEOUT dedicated worker: scheme = blob, value = (\) Test timed out 22 37 FAIL shared worker: withCoopCoep = false Can't find variable: SharedWorker 23 38 FAIL shared worker: withCoopCoep = true Can't find variable: SharedWorker -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/data.https-expected.txt
r249886 r280953 1 CONSOLE MESSAGE: Cancelled load to https://localhost:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 2 CONSOLE MESSAGE: Fetch API cannot load https://localhost:9443/common/blank.html due to access control checks. 1 3 2 FAIL Cross-Origin-Embedder-Policy and data: URLs assert_true: Cross-origin without CORP did not fail expected true got false 4 PASS Cross-Origin-Embedder-Policy and data: URLs 3 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https-expected.txt
r267646 r280953 1 CONSOLE MESSAGE: Refused to load 'https://localhost:9443/html/cross-origin-embedder-policy/resources/universal-worker.js?pipe=' worker because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 3 CONSOLE MESSAGE: Cannot load https://localhost:9443/html/cross-origin-embedder-policy/resources/universal-worker.js?pipe= due to access control checks. 4 CONSOLE MESSAGE: Refused to load 'https://localhost:9443/html/cross-origin-embedder-policy/resources/universal-worker.js?pipe=' worker because of Cross-Origin-Embedder-Policy. 5 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 6 CONSOLE MESSAGE: Cannot load https://localhost:9443/html/cross-origin-embedder-policy/resources/universal-worker.js?pipe= due to access control checks. 1 7 2 8 PASS coep-none coep-none corp-cross-origin 3 9 PASS coep-none coep-none corp-undefined 4 10 PASS coep-none coep-require-corp corp-cross-origin 5 FAIL coep-none coep-require-corp corp-undefined assert_equals: expected "failure" but got "success" 6 FAIL coep-require-corp coep-none corp-cross-origin assert_equals: expected "error" but got "success" 7 FAIL coep-require-corp coep-none corp-undefined assert_equals: expected "error" but got "success" 11 PASS coep-none coep-require-corp corp-undefined 12 PASS coep-require-corp coep-none corp-cross-origin 13 PASS coep-require-corp coep-none corp-undefined 8 14 PASS coep-require-corp coep-require-corp corp-cross-origin 9 FAIL coep-require-corp coep-require-corp corp-undefined assert_equals: expected "failure" but got "success" 15 PASS coep-require-corp coep-require-corp corp-undefined 10 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker.https-expected.txt
r267646 r280953 1 2 3 Harness Error (TIMEOUT), message = null 1 CONSOLE MESSAGE: Refused to load 'https://localhost:9443/html/cross-origin-embedder-policy/resources/dedicated-worker.js' worker because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 3 CONSOLE MESSAGE: Cannot load https://localhost:9443/html/cross-origin-embedder-policy/resources/dedicated-worker.js due to access control checks. 4 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 5 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 6 CONSOLE MESSAGE: Refused to load 'https://localhost:9443/html/cross-origin-embedder-policy/resources/dedicated-worker.js' worker because of Cross-Origin-Embedder-Policy. 7 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 8 CONSOLE MESSAGE: Cannot load https://localhost:9443/html/cross-origin-embedder-policy/resources/dedicated-worker.js due to access control checks. 9 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 10 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 4 11 5 12 PASS COEP: none worker in COEP: none frame 6 TIMEOUT COEP: none worker in COEP: require-corp frame Test timed out 7 NOTRUNCOEP: require-corp worker in COEP: none frame8 NOTRUNCOEP: require-corp worker in COEP: require-corp frame9 NOTRUNCOEP: none module worker in COEP: none frame10 NOTRUNCOEP: none module worker in COEP: require-corp frame11 NOTRUNCOEP: require-corp module worker in COEP: none frame12 NOTRUNCOEP: require-corp module worker in COEP: require-corp frame13 PASS COEP: none worker in COEP: require-corp frame 14 PASS COEP: require-corp worker in COEP: none frame 15 PASS COEP: require-corp worker in COEP: require-corp frame 16 PASS COEP: none module worker in COEP: none frame 17 PASS COEP: none module worker in COEP: require-corp frame 18 PASS COEP: require-corp module worker in COEP: none frame 19 PASS COEP: require-corp module worker in COEP: require-corp frame 13 20 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https-expected.txt
r279427 r280953 1 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 3 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 4 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 5 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 6 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 7 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 8 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 9 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 10 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 11 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 12 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 13 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 14 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 15 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 16 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 1 17 2 PASS navigation allowed for PASS navigation allowed for [""] 18 PASS navigation allowed for [] 19 PASS navigation allowed for [""] 3 20 PASS navigation allowed for ["jibberish"] 4 21 PASS navigation allowed for [{"percentEncoded":"require%FFcorp"}] … … 16 33 PASS navigation allowed for ["","require-corp"] 17 34 PASS navigation allowed for ["require-corp",""] 18 FAIL navigation blocked for ["require-corp"] assert_equals: expected null but got Document node with 1 child 19 FAIL navigation blocked for [" require-corp "] assert_equals: expected null but got Document node with 1 child 20 FAIL navigation blocked for ["\trequire-corp\t"] assert_equals: expected null but got Document node with 1 child 21 FAIL navigation blocked for [" \trequire-corp"] assert_equals: expected null but got Document node with 1 child 22 FAIL navigation blocked for ["require-corp\t "] assert_equals: expected null but got Document node with 1 child 23 FAIL navigation blocked for ["require-corp; foo=bar"] assert_equals: expected null but got Document node with 1 child 24 FAIL navigation blocked for ["require-corp;require-corp"] assert_equals: expected null but got Document node with 1 child 25 FAIL navigation blocked for ["require-corp; report-to=\"data:","\""] assert_equals: expected null but got Document node with 1 child 35 PASS navigation blocked for ["require-corp"] 36 PASS navigation blocked for [" require-corp "] 37 PASS navigation blocked for ["\trequire-corp\t"] 38 PASS navigation blocked for [" \trequire-corp"] 39 PASS navigation blocked for ["require-corp\t "] 40 PASS navigation blocked for ["require-corp; foo=bar"] 41 PASS navigation blocked for ["require-corp;require-corp"] 42 PASS navigation blocked for ["require-corp; report-to=\"data:","\""] 26 43 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/javascript.https-expected.txt
r264117 r280953 1 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks. 1 3 2 FAIL Cross-Origin-Embedder-Policy and javascript: URLs assert_true: Cross-origin without CORP did not fail expected true got false 4 PASS Cross-Origin-Embedder-Policy and javascript: URLs 3 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/multi-globals/workers-coep-report.https-expected.txt
r279427 r280953 4 4 } 5 5 })') 6 CONSOLE MESSAGE: Refused to load 'https://localhost:9443/html/cross-origin-embedder-policy/multi-globals/current/worker.js' worker because of Cross-Origin-Embedder-Policy. 7 CONSOLE MESSAGE: Worker load was blocked by Cross-Origin-Embedder-Policy 8 CONSOLE MESSAGE: Cannot load https://localhost:9443/html/cross-origin-embedder-policy/multi-globals/current/worker.js due to access control checks. 6 9 Hello 7 10 … … 12 15 })') 13 16 14 FAIL Multiple globals for Worker constructor: COEP reports assert_unreached: worker should have been blocked by COEP Reached unreachable code 17 TIMEOUT Multiple globals for Worker constructor: COEP reports Test timed out 15 18 19 Harness Error (FAIL), message = Unhandled rejection: undefined is not a constructor (evaluating 'new global.ReportingObserver((rs) => { 20 for (const r of rs) { 21 reports.push(r.toJSON()); 22 } 23 })') 24 25 TIMEOUT Multiple globals for Worker constructor: COEP reports Test timed out 26 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/no-secure-context-expected.txt
r267646 r280953 1 CONSOLE MESSAGE: Refused to display 'http://127.0.0.1:8800/html/cross-origin-embedder-policy/resources/iframe.html' in a frame because of Cross-Origin-Embedder-Policy. 1 2 2 PASS COEP requires a secure context 3 Harness Error (TIMEOUT), message = null 3 4 5 TIMEOUT COEP requires a secure context Test timed out 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none-sw-from-require-corp.https-expected.txt
r279427 r280953 1 1 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt because it violates the resource's Cross-Origin-Resource-Policy response header. 2 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt. 3 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 4 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks. 3 5 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough because it violates the resource's Cross-Origin-Resource-Policy response header. 4 6 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough due to access control checks. 7 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html?passthrough because it violates the resource's Cross-Origin-Resource-Policy response header. 8 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html?passthrough due to access control checks. 5 9 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin. 6 10 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html. … … 11 15 PASS making a same-origin request for CORP: cross-origin 12 16 PASS making a cross-origin request for CORP: same-origin 13 FAIL making a cross-origin request for no CORP assert_unreached: Should have rejected: undefined Reached unreachable code 17 PASS making a cross-origin request for no CORP 14 18 PASS making a cross-origin request for CORP: cross-origin 15 19 PASS making a cross-origin request for CORP: same-origin [PASS THROUGH] 16 FAIL making a cross-origin request for no CORP [PASS THROUGH] assert_unreached: Should have rejected: undefined Reached unreachable code 20 PASS making a cross-origin request for no CORP [PASS THROUGH] 17 21 PASS making a cross-origin request for CORP: cross-origin [PASS THROUGH] 18 22 PASS making a cross-origin request with CORS without ACAO -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt
r279427 r280953 1 2 Harness Error (TIMEOUT), message = null3 1 4 2 PASS "none" top-level: navigating a frame to "none" should succeed 5 3 PASS "none" top-level: navigating a frame from "require-corp" to "none" should succeed 6 TIMEOUT "none" top-level: navigating a frame back from "require-corp" should succeed Test timed out 7 FAIL "require-corp" top-level noopener popup: navigating to "none" should succeed Can't find variable: BroadcastChannel 4 PASS "none" top-level: navigating a frame back from "require-corp" should succeed 5 PASS "require-corp" top-level noopener popup: navigating to "none" should succeed 8 6 PASS CORP: same-site is not checked. 9 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https-expected.txt
r264117 r280953 1 $ 1 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/text-plain.txt?5770c451-7494-433b-8c09-b31f6ee4ffc8 because it violates the resource's Cross-Origin-Resource-Policy response header. 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/text-plain.txt?5770c451-7494-433b-8c09-b31f6ee4ffc8 due to access control checks. 3 CONSOLE MESSAGE: Refused to display 'https://127.0.0.1:9443/common/blank.html?61cf891c-f480-4336-8e40-08917296c4b1' in a frame because of Cross-Origin-Embedder-Policy. 4 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html?99e6eced-bb02-418a-b988-2339189a16a2' in a frame because of Cross-Origin-Embedder-Policy. 5 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html?03fa3aa7-2433-4e5d-af85-f3b4581de86a' in a frame because of Cross-Origin-Embedder-Policy. 2 6 3 FAIL subresource CORP assert_unreached: A report whose blocked-url is https://127.0.0.1:9443/common/text-plain.txt?5b94c235-d74d-4e80-b363-aa9bd466b1a6 and url is https://localhost:9443/html/cross-origin-embedder-policy/resources/reporting-empty-frame.html is not found. Reached unreachable code 4 FAIL navigation CORP assert_unreached: A report whose blocked-url is https://127.0.0.1:9443/common/blank.html?6f615216-f22f-41cb-a707-0b977efc3d6d and url is https://localhost:9443/html/cross-origin-embedder-policy/resources/reporting-empty-frame.html is not found. Reached unreachable code 5 FAIL COEP violation on nested frame navigation assert_unreached: A report whose blocked-url is https://localhost:9443/common/blank.html?f967cac2-4283-4ea6-8667-040244e52336 and url is https://localhost:9443/html/cross-origin-embedder-policy/resources/reporting-empty-frame.html is not found. Reached unreachable code 7 FAIL subresource CORP assert_unreached: A report whose blockedURL is https://127.0.0.1:9443/common/text-plain.txt?5770c451-7494-433b-8c09-b31f6ee4ffc8 and url is https://localhost:9443/html/cross-origin-embedder-policy/resources/reporting-empty-frame.html?pipe=header(cross-origin-embedder-policy,require-corp;report-to=%22endpoint%22)|header(cross-origin-embedder-policy-report-only,require-corp;report-to=%22report-only-endpoint%22) is not found. Reached unreachable code 8 FAIL navigation CORP assert_unreached: A report whose blockedURL is https://127.0.0.1:9443/common/blank.html?61cf891c-f480-4336-8e40-08917296c4b1 and url is https://localhost:9443/html/cross-origin-embedder-policy/resources/reporting-empty-frame.html?pipe=header(cross-origin-embedder-policy,require-corp;report-to=%22endpoint%22)|header(cross-origin-embedder-policy-report-only,require-corp;report-to=%22report-only-endpoint%22) is not found. Reached unreachable code 9 FAIL COEP violation on nested frame navigation assert_unreached: A report whose blockedURL is https://localhost:9443/common/blank.html?99e6eced-bb02-418a-b988-2339189a16a2 and url is https://localhost:9443/html/cross-origin-embedder-policy/resources/reporting-empty-frame.html?pipe=header(cross-origin-embedder-policy,require-corp;report-to=%22endpoint%22)|header(cross-origin-embedder-policy-report-only,require-corp;report-to=%22report-only-endpoint%22) is not found. Reached unreachable code 10 FAIL Two COEP headers, split inside report-to value assert_unreached: A report whose blockedURL is https://localhost:9443/common/blank.html?03fa3aa7-2433-4e5d-af85-f3b4581de86a and url is https://localhost:9443/html/cross-origin-embedder-policy/resources/reporting-empty-frame-multiple-headers.html.asis is not found. Reached unreachable code 6 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank.https-expected.txt
r269186 r280953 1 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 1 3 2 4 3 5 PASS Wait for the DOM to be built. 4 6 PASS about:blank can always be embedded by a 'require-corp' document 5 FAIL A(B(C)) A=require-corp, B=about:blank, C=no-require-corp => C can't load step_wait_func: Timed out waiting on condition 7 PASS A(B(C)) A=require-corp, B=about:blank, C=no-require-corp => C can't load 6 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc.https-expected.txt
r269186 r280953 1 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 1 3 2 4 3 5 PASS Wait for the DOM to be built. 4 6 PASS about:srcdoc can always be embedded by a 'require-corp' document 5 FAIL A(B(C)) A=require-corp, B=about:srcdoc, C=no-require-corp => C can't load step_wait_func: Timed out waiting on condition 7 PASS A(B(C)) A=require-corp, B=about:srcdoc, C=no-require-corp => C can't load 6 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-load-from-cache-storage.https-expected.txt
r267646 r280953 1 CONSOLE MESSAGE: Cache API operation failed: Cross-Origin-Resource-Policy failure 2 CONSOLE MESSAGE: Cache API operation failed: Cross-Origin-Resource-Policy failure 1 3 2 4 … … 26 28 PASS Fetch cross-origin no-cors cors-disabled corp-cross-origin from network and CacheStorage. 27 29 PASS Fetch cross-origin no-cors cors-disabled corp-same-origin from network and CacheStorage. 28 FAIL Fetch cross-origin no-cors cors-disabled corp-undefined from network and CacheStorage. assert_unreached: Should have rejected: undefined Reached unreachable code 30 PASS Fetch cross-origin no-cors cors-disabled corp-undefined from network and CacheStorage. 29 31 PASS Fetch cross-origin no-cors cors-enabled corp-cross-origin from network and CacheStorage. 30 32 PASS Fetch cross-origin no-cors cors-enabled corp-same-origin from network and CacheStorage. 31 FAIL Fetch cross-origin no-cors cors-enabled corp-undefined from network and CacheStorage. assert_unreached: Should have rejected: undefined Reached unreachable code 33 PASS Fetch cross-origin no-cors cors-enabled corp-undefined from network and CacheStorage. 32 34 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-none.https-expected.txt
r279427 r280953 1 1 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt because it violates the resource's Cross-Origin-Resource-Policy response header. 2 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt. 3 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 4 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html. 3 5 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough because it violates the resource's Cross-Origin-Resource-Policy response header. 4 6 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough due to access control checks. … … 11 13 PASS making a same-origin request for CORP: cross-origin 12 14 PASS making a cross-origin request for CORP: same-origin 13 FAIL making a cross-origin request for no CORP assert_unreached: Should have rejected: undefined Reached unreachable code 15 PASS making a cross-origin request for no CORP 14 16 PASS making a cross-origin request for CORP: cross-origin 15 17 PASS making a cross-origin request for CORP: same-origin [PASS THROUGH] -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-require-corp.https-expected.txt
r279427 r280953 1 1 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt because it violates the resource's Cross-Origin-Resource-Policy response header. 2 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt. 3 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 4 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html. 3 5 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough because it violates the resource's Cross-Origin-Resource-Policy response header. 4 6 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/nothing-same-origin-corp.txt?passthrough due to access control checks. 7 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html?passthrough because it violates the resource's Cross-Origin-Resource-Policy response header. 8 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html?passthrough due to access control checks. 5 9 CONSOLE MESSAGE: FetchEvent.respondWith received an error: TypeError: Origin https://localhost:9443 is not allowed by Access-Control-Allow-Origin. 6 10 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html. … … 11 15 PASS making a same-origin request for CORP: cross-origin 12 16 PASS making a cross-origin request for CORP: same-origin 13 FAIL making a cross-origin request for no CORP assert_unreached: Should have rejected: undefined Reached unreachable code 17 PASS making a cross-origin request for no CORP 14 18 PASS making a cross-origin request for CORP: cross-origin 15 19 PASS making a cross-origin request for CORP: same-origin [PASS THROUGH] 16 FAIL making a cross-origin request for no CORP [PASS THROUGH] assert_unreached: Should have rejected: undefined Reached unreachable code 20 PASS making a cross-origin request for no CORP [PASS THROUGH] 17 21 PASS making a cross-origin request for CORP: cross-origin [PASS THROUGH] 18 22 PASS making a cross-origin request with CORS without ACAO -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw.https-expected.txt
r267646 r280953 2 2 PASS Set up global state 3 3 PASS fetch() to 'CORP: cross-origin' response should succeed. 4 FAIL fetch() to no CORP response should not succeed. assert_equals: expected "Exception: TypeError" but got "opaque" 5 FAIL importScripts() fails for a script with no corp. assert_unreached: Should have rejected: register() should fail. Reached unreachable code 4 PASS fetch() to no CORP response should not succeed. 5 PASS importScripts() fails for a script with no corp. 6 6 PASS importScripts() succeeds for a script with corp: cross-origin. 7 7 PASS Clean up global state -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp.https-expected.txt
r279971 r280953 1 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 2 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 3 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "null" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 4 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html?token=5dcc16cb-9469-4bec-9602-a97aea5d9615 because it violates the resource's Cross-Origin-Resource-Policy response header. 5 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html?token=b26287fc-8f3f-4acc-8a8e-8a644072bf73 because it violates the resource's Cross-Origin-Resource-Policy response header. 6 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html?to=https%3A%2F%2Flocalhost%3A9443%2Fhtml%2Fcross-origin-embedder-policy%2Fresources%2Fnavigate-require-corp.sub.html%3FchannelName%3D8b07c736-9199-41a7-904c-4efbb7dfa027 because it violates the resource's Cross-Origin-Resource-Policy response header. 7 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/html/cross-origin-embedder-policy/resources/navigate-require-corp-same-site.sub.html?to=https%3A%2F%2F127.0.0.1%3A9443%2Fhtml%2Fcross-origin-embedder-policy%2Fresources%2Fnavigate-require-corp.sub.html%3FchannelName%3Ddda15abf-6fbe-457f-a03d-ee8d6c919d65 because it violates the resource's Cross-Origin-Resource-Policy response header. 8 CONSOLE MESSAGE: Refused to display 'https://127.0.0.1:9443/common/redirect.py?location=https%3A%2F%2Flocalhost%3A9443%2Fhtml%2Fcross-origin-embedder-policy%2Fresources%2Fnavigate-require-corp.sub.html%3FchannelName%3D8f6cafbd-6cff-4b57-b369-4045fca85b49' in a frame because of Cross-Origin-Embedder-Policy. 9 CONSOLE MESSAGE: Redirection was blocked by Cross-Origin-Embedder-Policy 10 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 11 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks. 12 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 13 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks. 14 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "null". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 15 CONSOLE MESSAGE: Refused to display 'https://localhost:9443/common/blank.html' in a frame because of Cross-Origin-Embedder-Policy. 16 CONSOLE MESSAGE: Sandbox access violation: Blocked a frame at "https://localhost:9443" from accessing a frame at "https://localhost:9443". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag. 1 17 2 FAIL "require-corp" top-level: navigating a frame to "none" should fail step_wait_func: Timed out waiting on condition 3 FAIL "require-corp" top-level: navigating a frame from "require-corp" to "none" should fail step_wait_func: Timed out waiting on condition 18 Harness Error (TIMEOUT), message = null 19 20 PASS "require-corp" top-level: navigating a frame to "none" should fail 21 PASS "require-corp" top-level: navigating a frame from "require-corp" to "none" should fail 4 22 PASS "require-corp" top-level: creating a noopener "none" popup should succeed 5 23 PASS "require-corp" top-level: creating a "none" popup should succeed. … … 8 26 PASS "require-corp" top-level (as popup with opener set to null): navigating to "none" should succeed 9 27 PASS "require-corp" top-level: fetch() to CORP: cross-origin response should succeed 10 FAIL "require-corp" top-level: fetch() to response without CORP should fail assert_unreached: Should have rejected: undefined Reached unreachable code 11 FAIL "require-corp" top-level: fetch() to response without CORP through a WindowProxy should fail assert_unreached: Should have rejected: undefined Reached unreachable code 12 FAIL "require-corp" top-level: navigating an iframe to a page without CORP, through a WindowProxy, should fail step_wait_func: Timed out waiting on condition 13 PASS CORP: same-site is checked and allowed. 14 FAIL CORP: same-site is checked and blocked. assert_false: expected false got true 15 PASS navigation CORP is checked with the parent frame, not the navigation source - to be allowed 28 PASS "require-corp" top-level: fetch() to response without CORP should fail 29 PASS "require-corp" top-level: fetch() to response without CORP through a WindowProxy should fail 30 PASS "require-corp" top-level: navigating an iframe to a page without CORP, through a WindowProxy, should fail 31 TIMEOUT CORP: same-site is checked and allowed. Test timed out 32 PASS CORP: same-site is checked and blocked. 33 TIMEOUT navigation CORP is checked with the parent frame, not the navigation source - to be allowed Test timed out 16 34 PASS navigation CORP is checked with the parent frame, not the navigation source - to be blocked 17 FAIL navigation CORP is checked for each redirect assert_false: expected false got true 35 PASS navigation CORP is checked for each redirect 18 36 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/sandbox.https-expected.txt
r249886 r280953 1 1 2 FAIL Cross-Origin-Embedder-Policy and sandbox assert_true: Request to same-origin resource without CORP did not fail expected true got false 2 PASS Cross-Origin-Embedder-Policy and sandbox 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/service-worker-cache-storage.https-expected.txt
r267646 r280953 2 2 PASS A ServiceWorker with coep-none use CacheStorage to get a corp-undefined response. 3 3 PASS A ServiceWorker with coep-none use CacheStorage to get a corp-cross-origin response. 4 FAIL A ServiceWorker with coep-require-corp use CacheStorage to get a corp-undefined response. assert_equals: expected false but got true 4 PASS A ServiceWorker with coep-require-corp use CacheStorage to get a corp-undefined response. 5 5 PASS A ServiceWorker with coep-require-corp use CacheStorage to get a corp-cross-origin response. 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/srcdoc.https-expected.txt
r249886 r280953 1 CONSOLE MESSAGE: Cancelled load to https://127.0.0.1:9443/common/blank.html because it violates the resource's Cross-Origin-Resource-Policy response header. 2 CONSOLE MESSAGE: Fetch API cannot load https://127.0.0.1:9443/common/blank.html due to access control checks. 1 3 2 FAIL Cross-Origin-Embedder-Policy and srcdoc assert_true: Cross-origin without CORP did not fail expected true got false 4 PASS Cross-Origin-Embedder-Policy and srcdoc 3 5 -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r280932 r280953 355 355 imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy [ Skip ] 356 356 imported/w3c/web-platform-tests/fetch/range/sw.https.window.html [ Skip ] 357 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-dedicated-worker.https.html [ Skip ]358 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-document.https.html [ Skip ]359 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-shared-worker.https.html [ Skip ]360 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https.html [ Skip ]361 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/reporting-subresource-corp.tentative.https.html [ Skip ]362 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless/service-worker.tentative.https.html [ Skip ]363 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html [ Skip ]364 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https.html [ Skip ]365 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https.html [ Skip ]366 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw.https.html [ Skip ]367 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/service-worker-cache-storage.https.html [ Skip ]368 357 imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html [ Skip ] 369 358 imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https.html [ Skip ] … … 384 373 http/wpt/webrtc/transfer-datachannel-service-worker.https.html [ Skip ] 385 374 375 # No Cross-Origin-Embedder-Policy in WK1. 376 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy [ Skip ] 377 http/wpt/html/cross-origin-embedder-policy/require-corp.https.html [ Skip ] 378 386 379 # Quota check missing in WK1 387 380 http/tests/IndexedDB/storage-limit.https.html [ Skip ] -
trunk/LayoutTests/platform/win/TestExpectations
r280923 r280953 3722 3722 imported/w3c/web-platform-tests/fetch/api/request/destination [ Skip ] 3723 3723 imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy [ Skip ] 3724 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-dedicated-worker.https.html [ Skip ]3725 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-document.https.html [ Skip ]3726 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/cache-storage-reporting-shared-worker.https.html [ Skip ]3727 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https.html [ Skip ]3728 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https.html [ Skip ]3729 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/reporting-subresource-corp.https.html [ Skip ]3730 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw.https.html [ Skip ]3731 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/service-worker-cache-storage.https.html [ Skip ]3732 3724 imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https.html [ Skip ] 3733 3725 imported/w3c/web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https.html [ Skip ] … … 3739 3731 imported/w3c/web-platform-tests/worklets/layout-worklet-service-worker-interception.https.html [ Skip ] 3740 3732 imported/w3c/web-platform-tests/worklets/paint-worklet-service-worker-interception.https.html [ Skip ] 3733 3734 # No Cross-Origin-Embedder-Policy in WK1. 3735 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy [ Skip ] 3736 http/wpt/html/cross-origin-embedder-policy/require-corp.https.html [ Skip ] 3741 3737 3742 3738 # No header filtering for WK1 -
trunk/Source/WTF/ChangeLog
r280952 r280953 1 2021-08-11 Chris Dumez <cdumez@apple.com> 2 3 Add initial support for Cross-Origin-Embedder-Policy (COEP) 4 https://bugs.webkit.org/show_bug.cgi?id=228754 5 6 Reviewed by Alex Christensen. 7 8 Add experimental feature flag for Cross-Origin-Embedder-Policy (COEP), off by default. 9 10 * Scripts/Preferences/WebPreferencesExperimental.yaml: 11 1 12 2021-08-11 Darin Adler <darin@apple.com> 2 13 -
trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
r280908 r280953 322 322 default: false 323 323 324 CrossOriginEmbedderPolicyEnabled: 325 type: bool 326 humanReadableName: "Cross-Origin-Embedder-Policy (COEP) header" 327 humanReadableDescription: "Support for Cross-Origin-Embedder-Policy (COEP) header" 328 defaultValue: 329 WebKitLegacy: 330 default: false 331 WebKit: 332 default: false 333 WebCore: 334 default: false 335 324 336 CrossOriginOpenerPolicyEnabled: 325 337 type: bool -
trunk/Source/WebCore/ChangeLog
r280948 r280953 1 2021-08-11 Chris Dumez <cdumez@apple.com> 2 3 Add initial support for Cross-Origin-Embedder-Policy (COEP) 4 https://bugs.webkit.org/show_bug.cgi?id=228754 5 6 Reviewed by Alex Christensen. 7 8 Add initial support for Cross-Origin-Embedder-Policy (COEP) behind a runtime feature flag, off by default: 9 - https://html.spec.whatwg.org/multipage/origin.html#coep 10 11 The COEP header has the following impacts: 12 - When a document with `Cross-Origin-Embedder-Policy: require-corp` loads an iframe or a worker script, if the network 13 response for that iframe doesn't also contain `Cross-Origin-Embedder-Policy: require-corp`, then we fail the load. 14 - When a document with `Cross-Origin-Embedder-Policy: require-corp` loads cross-origin subresources, then either CORS 15 must be used or the resource response must be allowed by Cross-Origin-Resource-Policy (CORP) header. 16 17 Support is only for WK2 and checks are done in the network process for better security. Support for workers and service 18 workers (including cache storage) is included. 19 20 Most of the Web-Platform-Tests for COEP are passing with this patch. The exceptions are: 21 - Some tests relying on Blob are failing. Similarly to COOP, Blobs need to inherit COEP from their 22 creator. This is currently unimplemented as the change will likely be non-trivial. I will follow-up 23 to fix Blob support for both COOP and COEP. 24 - Tests in the credentialless/ folder are failing because we do not support `Cross-Origin-Embedder-Policy: credentialless`. 25 This seems to be a fairly recent extension proposed by Google and it is not part of the HTML specification yet. 26 - Some tests expect violation reporting and they are failing and we do not implement reporting yet. 27 28 Note that `self.crossOriginIsolated` still returns false, even if the pages opts into both COOP & COEP, and APIs such 29 as SharedArrayBuffer still are not permitted to use. In order to support this, we will have to actually implement process 30 swapping so that we know a process is not actually shared by several origins. 31 32 Test: http/wpt/html/cross-origin-embedder-policy/require-corp.https.html 33 34 * Modules/cache/DOMCache.cpp: 35 (WebCore::DOMCache::queryCache): 36 * Modules/cache/DOMCacheEngine.cpp: 37 (WebCore::DOMCacheEngine::convertToException): 38 * Modules/cache/DOMCacheEngine.h: 39 * Modules/cache/RetrieveRecordsOptions.h: 40 (WebCore::RetrieveRecordsOptions::isolatedCopy const): 41 (WebCore::RetrieveRecordsOptions::encode const): 42 (WebCore::RetrieveRecordsOptions::decode): 43 * dom/Document.cpp: 44 (WebCore::Document::initSecurityContext): 45 * dom/SecurityContext.h: 46 (WebCore::SecurityContext::crossOriginEmbedderPolicy const): 47 (WebCore::SecurityContext::setCrossOriginEmbedderPolicy): 48 * loader/CrossOriginAccessControl.cpp: 49 (WebCore::shouldCrossOriginResourcePolicyCancelLoad): 50 (WebCore::validateCrossOriginResourcePolicy): 51 * loader/CrossOriginAccessControl.h: 52 * loader/CrossOriginEmbedderPolicy.cpp: 53 (WebCore::obtainCrossOriginEmbedderPolicy): 54 (WebCore::CrossOriginEmbedderPolicy::isolatedCopy const): 55 * loader/CrossOriginEmbedderPolicy.h: 56 (WebCore::CrossOriginEmbedderPolicy::encode const): 57 (WebCore::CrossOriginEmbedderPolicy::decode): 58 * loader/CrossOriginOpenerPolicy.cpp: 59 (WebCore::obtainCrossOriginOpenerPolicy): 60 * loader/DocumentThreadableLoader.cpp: 61 (WebCore::DocumentThreadableLoader::loadResourceSynchronously): 62 (WebCore::DocumentThreadableLoader::create): 63 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): 64 (WebCore::DocumentThreadableLoader::crossOriginEmbedderPolicy const): 65 * loader/DocumentThreadableLoader.h: 66 * loader/DocumentWriter.cpp: 67 (WebCore::DocumentWriter::begin): 68 * loader/FrameLoader.cpp: 69 (WebCore::FrameLoader::didBeginDocument): 70 * loader/ResourceLoaderOptions.h: 71 * loader/WorkerThreadableLoader.cpp: 72 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): 73 * loader/cache/CachedResourceLoader.cpp: 74 (WebCore::CachedResourceLoader::requestResource): 75 * page/SecurityOrigin.h: 76 * platform/network/HTTPParsers.cpp: 77 (WebCore::parseCrossOriginResourcePolicyHeader): 78 * platform/network/HTTPParsers.h: 79 * workers/Worker.cpp: 80 (WebCore::Worker::notifyFinished): 81 * workers/WorkerGlobalScope.cpp: 82 (WebCore::WorkerGlobalScope::WorkerGlobalScope): 83 * workers/WorkerGlobalScopeProxy.h: 84 * workers/WorkerMessagingProxy.cpp: 85 (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): 86 * workers/WorkerMessagingProxy.h: 87 * workers/WorkerScriptLoader.cpp: 88 (WebCore::WorkerScriptLoader::loadSynchronously): 89 (WebCore::WorkerScriptLoader::loadAsynchronously): 90 (WebCore::WorkerScriptLoader::didReceiveResponse): 91 * workers/WorkerScriptLoader.h: 92 (WebCore::WorkerScriptLoader::crossOriginEmbedderPolicy const): 93 * workers/WorkerThread.cpp: 94 (WebCore::WorkerParameters::isolatedCopy const): 95 * workers/WorkerThread.h: 96 * workers/service/ServiceWorkerContainer.cpp: 97 (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): 98 * workers/service/ServiceWorkerContainer.h: 99 * workers/service/ServiceWorkerContextData.cpp: 100 (WebCore::ServiceWorkerContextData::isolatedCopy const): 101 * workers/service/ServiceWorkerContextData.h: 102 (WebCore::ServiceWorkerContextData::encode const): 103 (WebCore::ServiceWorkerContextData::decode): 104 * workers/service/ServiceWorkerFetchResult.h: 105 (WebCore::ServiceWorkerFetchResult::isolatedCopy const): 106 (WebCore::serviceWorkerFetchError): 107 (WebCore::ServiceWorkerFetchResult::encode const): 108 (WebCore::ServiceWorkerFetchResult::decode): 109 * workers/service/ServiceWorkerJob.cpp: 110 (WebCore::ServiceWorkerJob::notifyFinished): 111 * workers/service/ServiceWorkerJobClient.h: 112 * workers/service/context/ServiceWorkerThread.cpp: 113 (WebCore::ServiceWorkerThread::ServiceWorkerThread): 114 * workers/service/server/RegistrationDatabase.cpp: 115 (WebCore::RegistrationDatabase::doPushChanges): 116 (WebCore::RegistrationDatabase::importRecords): 117 * workers/service/server/SWServer.cpp: 118 (WebCore::SWServer::addRegistrationFromStore): 119 (WebCore::SWServer::updateWorker): 120 (WebCore::SWServer::installContextData): 121 * workers/service/server/SWServer.h: 122 * workers/service/server/SWServerJobQueue.cpp: 123 (WebCore::SWServerJobQueue::scriptFetchFinished): 124 * workers/service/server/SWServerWorker.cpp: 125 (WebCore::SWServerWorker::SWServerWorker): 126 (WebCore::SWServerWorker::contextData const): 127 * workers/service/server/SWServerWorker.h: 128 1 129 2021-08-11 Jean-Yves Avenard <jya@apple.com> 2 130 -
trunk/Source/WebCore/Modules/cache/DOMCache.cpp
r278714 r280953 453 453 void DOMCache::queryCache(ResourceRequest&& request, const CacheQueryOptions& options, ShouldRetrieveResponses shouldRetrieveResponses, RecordsCallback&& callback) 454 454 { 455 RetrieveRecordsOptions retrieveOptions { WTFMove(request), options.ignoreSearch, options.ignoreMethod, options.ignoreVary, shouldRetrieveResponses == ShouldRetrieveResponses::Yes };455 RetrieveRecordsOptions retrieveOptions { WTFMove(request), scriptExecutionContext()->crossOriginEmbedderPolicy(), *scriptExecutionContext()->securityOrigin(), options.ignoreSearch, options.ignoreMethod, options.ignoreVary, shouldRetrieveResponses == ShouldRetrieveResponses::Yes }; 456 456 m_connection->retrieveRecords(m_identifier, retrieveOptions, [this, pendingActivity = makePendingActivity(*this), callback = WTFMove(callback)](auto&& result) mutable { 457 457 if (m_isStopped) { -
trunk/Source/WebCore/Modules/cache/DOMCacheEngine.cpp
r278669 r280953 29 29 30 30 #include "CacheQueryOptions.h" 31 #include "CrossOriginAccessControl.h" 31 32 #include "Exception.h" 32 33 #include "HTTPParsers.h" … … 52 53 case Error::Stopped: 53 54 return Exception { TypeError, "Context is stopped"_s }; 55 case Error::CORP: 56 return Exception { TypeError, "Cross-Origin-Resource-Policy failure"_s }; 54 57 } 55 58 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/Modules/cache/DOMCacheEngine.h
r278253 r280953 42 42 namespace DOMCacheEngine { 43 43 44 enum class Error {44 enum class Error : uint8_t { 45 45 NotImplemented, 46 46 ReadDisk, … … 48 48 QuotaExceeded, 49 49 Internal, 50 Stopped 50 Stopped, 51 CORP 51 52 }; 52 53 … … 171 172 WebCore::DOMCacheEngine::Error::WriteDisk, 172 173 WebCore::DOMCacheEngine::Error::QuotaExceeded, 173 WebCore::DOMCacheEngine::Error::Internal 174 WebCore::DOMCacheEngine::Error::Internal, 175 WebCore::DOMCacheEngine::Error::Stopped, 176 WebCore::DOMCacheEngine::Error::CORP 174 177 >; 175 178 }; -
trunk/Source/WebCore/Modules/cache/RetrieveRecordsOptions.h
r278253 r280953 27 27 #pragma once 28 28 29 #include "CrossOriginEmbedderPolicy.h" 29 30 #include "ResourceRequest.h" 31 #include "SecurityOrigin.h" 30 32 31 33 namespace WebCore { 32 34 33 35 struct RetrieveRecordsOptions { 34 RetrieveRecordsOptions isolatedCopy() const { return { request.isolatedCopy(), ignoreSearch, ignoreMethod, ignoreVary, shouldProvideResponse }; }36 RetrieveRecordsOptions isolatedCopy() const { return { request.isolatedCopy(), crossOriginEmbedderPolicy.isolatedCopy(), sourceOrigin->isolatedCopy(), ignoreSearch, ignoreMethod, ignoreVary, shouldProvideResponse }; } 35 37 36 38 template<class Encoder> void encode(Encoder&) const; … … 38 40 39 41 ResourceRequest request; 42 CrossOriginEmbedderPolicy crossOriginEmbedderPolicy; 43 Ref<SecurityOrigin> sourceOrigin; 40 44 bool ignoreSearch { false }; 41 45 bool ignoreMethod { false }; … … 46 50 template<class Encoder> inline void RetrieveRecordsOptions::encode(Encoder& encoder) const 47 51 { 48 encoder << request << ignoreSearch << ignoreMethod << ignoreVary << shouldProvideResponse;52 encoder << request << crossOriginEmbedderPolicy << sourceOrigin.get() << ignoreSearch << ignoreMethod << ignoreVary << shouldProvideResponse; 49 53 } 50 54 … … 54 58 decoder >> request; 55 59 if (!request) 60 return std::nullopt; 61 62 std::optional<CrossOriginEmbedderPolicy> crossOriginEmbedderPolicy; 63 decoder >> crossOriginEmbedderPolicy; 64 if (!crossOriginEmbedderPolicy) 65 return std::nullopt; 66 67 auto sourceOrigin = SecurityOrigin::decode(decoder); 68 if (!sourceOrigin) 56 69 return std::nullopt; 57 70 … … 76 89 return std::nullopt; 77 90 78 return { { WTFMove(*request), WTFMove(* ignoreSearch), WTFMove(*ignoreMethod), WTFMove(*ignoreVary), WTFMove(*shouldProvideResponse) } };91 return { { WTFMove(*request), WTFMove(*crossOriginEmbedderPolicy), sourceOrigin.releaseNonNull(), WTFMove(*ignoreSearch), WTFMove(*ignoreMethod), WTFMove(*ignoreVary), WTFMove(*shouldProvideResponse) } }; 79 92 } 80 93 -
trunk/Source/WebCore/dom/Document.cpp
r280870 r280953 6271 6271 contentSecurityPolicy()->updateSourceSelf(ownerFrame->document()->securityOrigin()); 6272 6272 6273 setCrossOriginEmbedderPolicy(ownerFrame->document()->crossOriginEmbedderPolicy()); 6274 6273 6275 // https://html.spec.whatwg.org/multipage/browsers.html#creating-a-new-browsing-context (Step 12) 6274 6276 // If creator is non-null and creator's origin is same origin with creator's relevant settings object's top-level origin, then set coop -
trunk/Source/WebCore/dom/SecurityContext.h
r280504 r280953 28 28 #pragma once 29 29 30 #include "CrossOriginEmbedderPolicy.h" 30 31 #include <memory> 31 32 #include <wtf/Forward.h> … … 88 89 void setContentSecurityPolicy(std::unique_ptr<ContentSecurityPolicy>&&); 89 90 91 const CrossOriginEmbedderPolicy& crossOriginEmbedderPolicy() const { return m_crossOriginEmbedderPolicy; } 92 void setCrossOriginEmbedderPolicy(const CrossOriginEmbedderPolicy& crossOriginEmbedderPolicy) { m_crossOriginEmbedderPolicy = crossOriginEmbedderPolicy; } 93 90 94 WEBCORE_EXPORT SecurityOrigin* securityOrigin() const; 91 95 … … 131 135 RefPtr<SecurityOriginPolicy> m_securityOriginPolicy; 132 136 std::unique_ptr<ContentSecurityPolicy> m_contentSecurityPolicy; 137 CrossOriginEmbedderPolicy m_crossOriginEmbedderPolicy; 133 138 SandboxFlags m_creationSandboxFlags { SandboxNone }; 134 139 SandboxFlags m_sandboxFlags { SandboxNone }; -
trunk/Source/WebCore/loader/CrossOriginAccessControl.cpp
r279750 r280953 29 29 30 30 #include "CachedResourceRequest.h" 31 #include "CrossOriginEmbedderPolicy.h" 31 32 #include "CrossOriginPreflightResultCache.h" 32 33 #include "HTTPHeaderNames.h" … … 281 282 } 282 283 283 static inline bool shouldCrossOriginResourcePolicyCancelLoad(const SecurityOrigin& origin, const ResourceResponse& response) 284 { 285 if (origin.canRequest(response.url())) 284 // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-internal-check 285 static inline bool shouldCrossOriginResourcePolicyCancelLoad(CrossOriginEmbedderPolicyValue coep, const SecurityOrigin& origin, const ResourceResponse& response, ForNavigation forNavigation) 286 { 287 if (forNavigation == ForNavigation::Yes && coep != CrossOriginEmbedderPolicyValue::RequireCORP) 286 288 return false; 287 289 290 if (response.isNull() || origin.canRequest(response.url())) 291 return false; 292 288 293 auto policy = parseCrossOriginResourcePolicyHeader(response.httpHeaderField(HTTPHeaderName::CrossOriginResourcePolicy)); 294 295 // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-internal-check (step 4). 296 if ((policy == CrossOriginResourcePolicy::None || policy == CrossOriginResourcePolicy::Invalid) && coep == CrossOriginEmbedderPolicyValue::RequireCORP) 297 return true; 289 298 290 299 if (policy == CrossOriginResourcePolicy::SameOrigin) … … 305 314 } 306 315 307 std::optional<ResourceError> validateCrossOriginResourcePolicy( const SecurityOrigin& origin, const URL& requestURL, const ResourceResponse& response)308 { 309 if (shouldCrossOriginResourcePolicyCancelLoad( origin, response))316 std::optional<ResourceError> validateCrossOriginResourcePolicy(CrossOriginEmbedderPolicyValue coep, const SecurityOrigin& origin, const URL& requestURL, const ResourceResponse& response, ForNavigation forNavigation) 317 { 318 if (shouldCrossOriginResourcePolicyCancelLoad(coep, origin, response, forNavigation)) 310 319 return ResourceError { errorDomainWebKitInternal, 0, requestURL, makeString("Cancelled load to ", response.url().stringCenterEllipsizedToLength(), " because it violates the resource's Cross-Origin-Resource-Policy response header."), ResourceError::Type::AccessControl }; 311 320 return std::nullopt; -
trunk/Source/WebCore/loader/CrossOriginAccessControl.h
r278849 r280953 50 50 struct ResourceLoaderOptions; 51 51 52 enum class CrossOriginEmbedderPolicyValue : bool; 53 52 54 WEBCORE_EXPORT bool isSimpleCrossOriginAccessRequest(const String& method, const HTTPHeaderMap&); 53 55 bool isOnAccessControlSimpleRequestMethodAllowlist(const String&); … … 85 87 WEBCORE_EXPORT Expected<void, String> validatePreflightResponse(PAL::SessionID, const ResourceRequest&, const ResourceResponse&, StoredCredentialsPolicy, const SecurityOrigin&, const CrossOriginAccessControlCheckDisabler*); 86 88 87 WEBCORE_EXPORT std::optional<ResourceError> validateCrossOriginResourcePolicy(const SecurityOrigin&, const URL&, const ResourceResponse&); 89 enum class ForNavigation : bool { No, Yes }; 90 WEBCORE_EXPORT std::optional<ResourceError> validateCrossOriginResourcePolicy(CrossOriginEmbedderPolicyValue, const SecurityOrigin&, const URL&, const ResourceResponse&, ForNavigation); 88 91 std::optional<ResourceError> validateRangeRequestedFlag(const ResourceRequest&, const ResourceResponse&); 89 92 String validateCrossOriginRedirectionURL(const URL&); -
trunk/Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp
r280890 r280953 31 31 #include "ResourceResponse.h" 32 32 #include "ScriptExecutionContext.h" 33 #include "SecurityOrigin.h" 33 34 34 35 namespace WebCore { 35 36 36 37 // https://html.spec.whatwg.org/multipage/origin.html#obtain-an-embedder-policy 37 CrossOriginEmbedderPolicy obtainCrossOriginEmbedderPolicy(const ResourceResponse& response, const ScriptExecutionContext& context)38 CrossOriginEmbedderPolicy obtainCrossOriginEmbedderPolicy(const ResourceResponse& response, IsSecureContext isSecureContext) 38 39 { 39 40 auto parseCOEPHeader = [&response](HTTPHeaderName headerName, auto& value, auto& reportingEndpoint) { … … 46 47 47 48 CrossOriginEmbedderPolicy policy; 48 // FIXME: about:blank should be marked as secure as per https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url. 49 if (!context.isSecureContext() && context.url() != aboutBlankURL() && !context.url().isEmpty()) 49 if (isSecureContext == IsSecureContext::No) 50 50 return policy; 51 51 … … 55 55 } 56 56 57 CrossOriginEmbedderPolicy obtainCrossOriginEmbedderPolicy(const ResourceResponse& response, const ScriptExecutionContext& context) 58 { 59 if (!context.settingsValues().crossOriginEmbedderPolicyEnabled) 60 return { }; 61 62 // FIXME: about:blank should be marked as secure as per https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url. 63 auto isSecureContext = context.isSecureContext() || context.url() == aboutBlankURL() || context.url().isEmpty() ? IsSecureContext::Yes : IsSecureContext::No; 64 return obtainCrossOriginEmbedderPolicy(response, isSecureContext); 65 } 66 67 CrossOriginEmbedderPolicy CrossOriginEmbedderPolicy::isolatedCopy() const 68 { 69 return { 70 value, 71 reportingEndpoint.isolatedCopy(), 72 reportOnlyValue, 73 reportOnlyReportingEndpoint.isolatedCopy() 74 }; 75 } 76 57 77 } // namespace WebCore -
trunk/Source/WebCore/loader/CrossOriginEmbedderPolicy.h
r280504 r280953 45 45 CrossOriginEmbedderPolicyValue reportOnlyValue { CrossOriginEmbedderPolicyValue::UnsafeNone }; 46 46 String reportOnlyReportingEndpoint; 47 48 CrossOriginEmbedderPolicy isolatedCopy() const; 49 template<class Encoder> void encode(Encoder&) const; 50 template<class Decoder> static std::optional<CrossOriginEmbedderPolicy> decode(Decoder&); 47 51 }; 52 53 template<class Encoder> 54 void CrossOriginEmbedderPolicy::encode(Encoder& encoder) const 55 { 56 encoder << value << reportingEndpoint << reportOnlyValue << reportOnlyReportingEndpoint; 57 } 58 59 template<class Decoder> 60 std::optional<CrossOriginEmbedderPolicy> CrossOriginEmbedderPolicy::decode(Decoder& decoder) 61 { 62 std::optional<CrossOriginEmbedderPolicyValue> value; 63 decoder >> value; 64 if (!value) 65 return std::nullopt; 66 67 std::optional<String> reportingEndpoint; 68 decoder >> reportingEndpoint; 69 if (!reportingEndpoint) 70 return std::nullopt; 71 72 std::optional<CrossOriginEmbedderPolicyValue> reportOnlyValue; 73 decoder >> reportOnlyValue; 74 if (!reportOnlyValue) 75 return std::nullopt; 76 77 std::optional<String> reportOnlyReportingEndpoint; 78 decoder >> reportOnlyReportingEndpoint; 79 if (!reportOnlyReportingEndpoint) 80 return std::nullopt; 81 82 return {{ 83 *value, 84 WTFMove(*reportingEndpoint), 85 *reportOnlyValue, 86 WTFMove(*reportOnlyReportingEndpoint) 87 }}; 88 } 48 89 49 90 CrossOriginEmbedderPolicy obtainCrossOriginEmbedderPolicy(const ResourceResponse&, const ScriptExecutionContext&); 50 91 92 enum class IsSecureContext : bool { No, Yes }; 93 WEBCORE_EXPORT CrossOriginEmbedderPolicy obtainCrossOriginEmbedderPolicy(const ResourceResponse&, IsSecureContext); 94 51 95 } // namespace WebCore -
trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.cpp
r280890 r280953 76 76 77 77 CrossOriginOpenerPolicy policy; 78 if (!context.settingsValues().crossOriginOpenerPolicyEnabled) 79 return policy; 78 80 // FIXME: about:blank should be marked as secure as per https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url. 79 81 if (!context.isSecureContext() && context.url() != aboutBlankURL() && !context.url().isEmpty()) -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r278800 r280953 71 71 namespace WebCore { 72 72 73 void DocumentThreadableLoader::loadResourceSynchronously(Document& document, ResourceRequest&& request, ThreadableLoaderClient& client, const ThreadableLoaderOptions& options, RefPtr<SecurityOrigin>&& origin, std::unique_ptr<ContentSecurityPolicy>&& contentSecurityPolicy )73 void DocumentThreadableLoader::loadResourceSynchronously(Document& document, ResourceRequest&& request, ThreadableLoaderClient& client, const ThreadableLoaderOptions& options, RefPtr<SecurityOrigin>&& origin, std::unique_ptr<ContentSecurityPolicy>&& contentSecurityPolicy, std::optional<CrossOriginEmbedderPolicy>&& crossOriginEmbedderPolicy) 74 74 { 75 75 // The loader will be deleted as soon as this function exits. 76 Ref<DocumentThreadableLoader> loader = adoptRef(*new DocumentThreadableLoader(document, client, LoadSynchronously, WTFMove(request), options, WTFMove(origin), WTFMove(contentSecurityPolicy), String(), ShouldLogError::Yes));76 Ref<DocumentThreadableLoader> loader = adoptRef(*new DocumentThreadableLoader(document, client, LoadSynchronously, WTFMove(request), options, WTFMove(origin), WTFMove(contentSecurityPolicy), WTFMove(crossOriginEmbedderPolicy), String(), ShouldLogError::Yes)); 77 77 ASSERT(loader->hasOneRef()); 78 78 } … … 80 80 void DocumentThreadableLoader::loadResourceSynchronously(Document& document, ResourceRequest&& request, ThreadableLoaderClient& client, const ThreadableLoaderOptions& options) 81 81 { 82 loadResourceSynchronously(document, WTFMove(request), client, options, nullptr, nullptr );82 loadResourceSynchronously(document, WTFMove(request), client, options, nullptr, nullptr, std::nullopt); 83 83 } 84 84 85 85 RefPtr<DocumentThreadableLoader> DocumentThreadableLoader::create(Document& document, ThreadableLoaderClient& client, 86 86 ResourceRequest&& request, const ThreadableLoaderOptions& options, RefPtr<SecurityOrigin>&& origin, 87 std::unique_ptr<ContentSecurityPolicy>&& contentSecurityPolicy, String&& referrer, ShouldLogError shouldLogError)88 { 89 RefPtr<DocumentThreadableLoader> loader = adoptRef(new DocumentThreadableLoader(document, client, LoadAsynchronously, WTFMove(request), options, WTFMove(origin), WTFMove(contentSecurityPolicy), WTFMove( referrer), shouldLogError));87 std::unique_ptr<ContentSecurityPolicy>&& contentSecurityPolicy, std::optional<CrossOriginEmbedderPolicy>&& crossOriginEmbedderPolicy, String&& referrer, ShouldLogError shouldLogError) 88 { 89 RefPtr<DocumentThreadableLoader> loader = adoptRef(new DocumentThreadableLoader(document, client, LoadAsynchronously, WTFMove(request), options, WTFMove(origin), WTFMove(contentSecurityPolicy), WTFMove(crossOriginEmbedderPolicy), WTFMove(referrer), shouldLogError)); 90 90 if (!loader->isLoading()) 91 91 loader = nullptr; … … 95 95 RefPtr<DocumentThreadableLoader> DocumentThreadableLoader::create(Document& document, ThreadableLoaderClient& client, ResourceRequest&& request, const ThreadableLoaderOptions& options, String&& referrer) 96 96 { 97 return create(document, client, WTFMove(request), options, nullptr, nullptr, WTFMove(referrer), ShouldLogError::Yes);97 return create(document, client, WTFMove(request), options, nullptr, nullptr, std::nullopt, WTFMove(referrer), ShouldLogError::Yes); 98 98 } 99 99 … … 116 116 } 117 117 118 DocumentThreadableLoader::DocumentThreadableLoader(Document& document, ThreadableLoaderClient& client, BlockingBehavior blockingBehavior, ResourceRequest&& request, const ThreadableLoaderOptions& options, RefPtr<SecurityOrigin>&& origin, std::unique_ptr<ContentSecurityPolicy>&& contentSecurityPolicy, String&& referrer, ShouldLogError shouldLogError)118 DocumentThreadableLoader::DocumentThreadableLoader(Document& document, ThreadableLoaderClient& client, BlockingBehavior blockingBehavior, ResourceRequest&& request, const ThreadableLoaderOptions& options, RefPtr<SecurityOrigin>&& origin, std::unique_ptr<ContentSecurityPolicy>&& contentSecurityPolicy, std::optional<CrossOriginEmbedderPolicy>&& crossOriginEmbedderPolicy, String&& referrer, ShouldLogError shouldLogError) 119 119 : m_client(&client) 120 120 , m_document(document) … … 127 127 , m_delayCallbacksForIntegrityCheck(!m_options.integrity.isEmpty()) 128 128 , m_contentSecurityPolicy(WTFMove(contentSecurityPolicy)) 129 , m_crossOriginEmbedderPolicy(WTFMove(crossOriginEmbedderPolicy)) 129 130 , m_shouldLogError(shouldLogError) 130 131 { … … 167 168 168 169 m_options.cspResponseHeaders = m_options.contentSecurityPolicyEnforcement != ContentSecurityPolicyEnforcement::DoNotEnforce ? this->contentSecurityPolicy().responseHeaders() : ContentSecurityPolicyResponseHeaders { }; 170 m_options.crossOriginEmbedderPolicy = this->crossOriginEmbedderPolicy(); 169 171 170 172 // As per step 11 of https://fetch.spec.whatwg.org/#main-fetch, data scheme (if same-origin data-URL flag is set) and about scheme are considered same-origin. … … 711 713 } 712 714 715 const CrossOriginEmbedderPolicy& DocumentThreadableLoader::crossOriginEmbedderPolicy() const 716 { 717 if (m_crossOriginEmbedderPolicy) 718 return *m_crossOriginEmbedderPolicy; 719 return m_document.crossOriginEmbedderPolicy(); 720 } 721 713 722 void DocumentThreadableLoader::reportRedirectionWithBadScheme(const URL& url) 714 723 { -
trunk/Source/WebCore/loader/DocumentThreadableLoader.h
r278516 r280953 48 48 WTF_MAKE_FAST_ALLOCATED; 49 49 public: 50 static void loadResourceSynchronously(Document&, ResourceRequest&&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, RefPtr<SecurityOrigin>&&, std::unique_ptr<ContentSecurityPolicy>&& );50 static void loadResourceSynchronously(Document&, ResourceRequest&&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, RefPtr<SecurityOrigin>&&, std::unique_ptr<ContentSecurityPolicy>&&, std::optional<CrossOriginEmbedderPolicy>&&); 51 51 static void loadResourceSynchronously(Document&, ResourceRequest&&, ThreadableLoaderClient&, const ThreadableLoaderOptions&); 52 52 53 53 enum class ShouldLogError { No, Yes }; 54 static RefPtr<DocumentThreadableLoader> create(Document&, ThreadableLoaderClient&, ResourceRequest&&, const ThreadableLoaderOptions&, RefPtr<SecurityOrigin>&&, std::unique_ptr<ContentSecurityPolicy>&&, String&& referrer, ShouldLogError);54 static RefPtr<DocumentThreadableLoader> create(Document&, ThreadableLoaderClient&, ResourceRequest&&, const ThreadableLoaderOptions&, RefPtr<SecurityOrigin>&&, std::unique_ptr<ContentSecurityPolicy>&&, std::optional<CrossOriginEmbedderPolicy>&&, String&& referrer, ShouldLogError); 55 55 static RefPtr<DocumentThreadableLoader> create(Document&, ThreadableLoaderClient&, ResourceRequest&&, const ThreadableLoaderOptions&, String&& referrer = String()); 56 56 … … 79 79 }; 80 80 81 DocumentThreadableLoader(Document&, ThreadableLoaderClient&, BlockingBehavior, ResourceRequest&&, const ThreadableLoaderOptions&, RefPtr<SecurityOrigin>&&, std::unique_ptr<ContentSecurityPolicy>&&, String&&, ShouldLogError);81 DocumentThreadableLoader(Document&, ThreadableLoaderClient&, BlockingBehavior, ResourceRequest&&, const ThreadableLoaderOptions&, RefPtr<SecurityOrigin>&&, std::unique_ptr<ContentSecurityPolicy>&&, std::optional<CrossOriginEmbedderPolicy>&&, String&&, ShouldLogError); 82 82 83 83 void clearResource(); … … 108 108 SecurityOrigin& securityOrigin() const; 109 109 const ContentSecurityPolicy& contentSecurityPolicy() const; 110 const CrossOriginEmbedderPolicy& crossOriginEmbedderPolicy() const; 110 111 111 112 Document& document() { return m_document; } … … 135 136 bool m_delayCallbacksForIntegrityCheck; 136 137 std::unique_ptr<ContentSecurityPolicy> m_contentSecurityPolicy; 138 std::optional<CrossOriginEmbedderPolicy> m_crossOriginEmbedderPolicy; 137 139 std::optional<CrossOriginPreflightChecker> m_preflightChecker; 138 140 std::optional<HTTPHeaderMap> m_originalHeaders; -
trunk/Source/WebCore/loader/DocumentWriter.cpp
r280504 r280953 176 176 document->setSecurityOriginPolicy(ownerDocument->securityOriginPolicy()); 177 177 document->setStrictMixedContentMode(ownerDocument->isStrictMixedContentMode()); 178 document->setCrossOriginEmbedderPolicy(ownerDocument->crossOriginEmbedderPolicy()); 178 179 179 180 document->setContentSecurityPolicy(makeUnique<ContentSecurityPolicy>(URL { url }, document)); … … 184 185 document->setContentSecurityPolicy(makeUnique<ContentSecurityPolicy>(URL { url }, document)); 185 186 document->contentSecurityPolicy()->copyStateFrom(existingDocument->contentSecurityPolicy()); 187 document->setCrossOriginEmbedderPolicy(existingDocument->crossOriginEmbedderPolicy()); 186 188 187 189 // Fix up 'self' for blob: and data:, which is inherited from its embedding document or opener. -
trunk/Source/WebCore/loader/FrameLoader.cpp
r280870 r280953 51 51 #include "ContentSecurityPolicy.h" 52 52 #include "CrossOriginAccessControl.h" 53 #include "CrossOriginEmbedderPolicy.h" 53 54 #include "DOMWindow.h" 54 55 #include "DatabaseManager.h" … … 751 752 m_frame.document()->contentSecurityPolicy()->didReceiveHeaders(ContentSecurityPolicyResponseHeaders(m_documentLoader->response()), referrer(), ContentSecurityPolicy::ReportParsingErrors::No); 752 753 754 if (m_frame.document()->url().protocolIsInHTTPFamily()) 755 m_frame.document()->setCrossOriginEmbedderPolicy(obtainCrossOriginEmbedderPolicy(m_documentLoader->response(), *m_frame.document())); 756 753 757 String referrerPolicy = m_documentLoader->response().httpHeaderField(HTTPHeaderName::ReferrerPolicy); 754 758 if (!referrerPolicy.isNull()) -
trunk/Source/WebCore/loader/ResourceLoaderOptions.h
r263218 r280953 33 33 #include "ContentSecurityPolicyResponseHeaders.h" 34 34 #include "CrossOriginAccessControl.h" 35 #include "CrossOriginEmbedderPolicy.h" 35 36 #include "FetchOptions.h" 36 37 #include "HTTPHeaderNames.h" … … 201 202 #endif 202 203 Markable<ContentSecurityPolicyResponseHeaders, ContentSecurityPolicyResponseHeaders::MarkableTraits> cspResponseHeaders; 204 std::optional<CrossOriginEmbedderPolicy> crossOriginEmbedderPolicy; 203 205 OptionSet<HTTPHeadersToKeepFromCleaning> httpHeadersToKeep; 204 206 uint8_t maxRedirectCount { 20 }; -
trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp
r278516 r280953 125 125 contentSecurityPolicyCopy->copyStateFrom(contentSecurityPolicy); 126 126 contentSecurityPolicyCopy->copyUpgradeInsecureRequestStateFrom(*contentSecurityPolicy); 127 auto crossOriginEmbedderPolicyCopy = globalScope.crossOriginEmbedderPolicy().isolatedCopy(); 127 128 128 129 auto optionsCopy = makeUnique<LoaderTaskOptions>(options, request.httpReferrer().isNull() ? outgoingReferrer : request.httpReferrer(), WTFMove(securityOriginCopy)); … … 142 143 143 144 // Can we benefit from request being an r-value to create more efficiently its isolated copy? 144 m_loaderProxy.postTaskToLoader([this, request = request.isolatedCopy(), options = WTFMove(optionsCopy), contentSecurityPolicyCopy = WTFMove(contentSecurityPolicyCopy) ](ScriptExecutionContext& context) mutable {145 m_loaderProxy.postTaskToLoader([this, request = request.isolatedCopy(), options = WTFMove(optionsCopy), contentSecurityPolicyCopy = WTFMove(contentSecurityPolicyCopy), crossOriginEmbedderPolicyCopy = WTFMove(crossOriginEmbedderPolicyCopy)](ScriptExecutionContext& context) mutable { 145 146 ASSERT(isMainThread()); 146 147 Document& document = downcast<Document>(context); … … 148 149 // FIXME: If the site requests a local resource, then this will return a non-zero value but the sync path will return a 0 value. 149 150 // Either this should return 0 or the other code path should call a failure callback. 150 m_mainThreadLoader = DocumentThreadableLoader::create(document, *this, WTFMove(request), options->options, WTFMove(options->origin), WTFMove(contentSecurityPolicyCopy), WTFMove( options->referrer), DocumentThreadableLoader::ShouldLogError::No);151 m_mainThreadLoader = DocumentThreadableLoader::create(document, *this, WTFMove(request), options->options, WTFMove(options->origin), WTFMove(contentSecurityPolicyCopy), WTFMove(crossOriginEmbedderPolicyCopy), WTFMove(options->referrer), DocumentThreadableLoader::ShouldLogError::No); 151 152 ASSERT(m_mainThreadLoader || m_loadingFinished); 152 153 }); -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r280081 r280953 1006 1006 case Use: 1007 1007 ASSERT(resource); 1008 if (request.options().mode == FetchOptions::Mode::Navigate && !frame.isMainFrame()) { 1009 if (auto* parentDocument = frame.tree().parent() ? frame.tree().parent()->document() : nullptr) { 1010 auto coep = parentDocument->crossOriginEmbedderPolicy().value; 1011 if (auto error = validateCrossOriginResourcePolicy(coep, parentDocument->securityOrigin(), request.resourceRequest().url(), resource->response(), ForNavigation::Yes)) 1012 return makeUnexpected(WTFMove(*error)); 1013 } 1014 } 1008 1015 if (request.options().mode == FetchOptions::Mode::NoCors) { 1009 if (auto error = validateCrossOriginResourcePolicy(*request.origin(), request.resourceRequest().url(), resource->response())) 1016 auto coep = document() ? document()->crossOriginEmbedderPolicy().value : CrossOriginEmbedderPolicyValue::UnsafeNone; 1017 if (auto error = validateCrossOriginResourcePolicy(coep, *request.origin(), request.resourceRequest().url(), resource->response(), ForNavigation::No)) 1010 1018 return makeUnexpected(WTFMove(*error)); 1011 1019 -
trunk/Source/WebCore/page/SecurityOrigin.h
r278806 r280953 90 90 // own protocol, or, when relevant, on the protocol of its "inner URL" 91 91 // Protocols like blob: and filesystem: fall into this latter category. 92 static bool isSecure(const URL&);92 WEBCORE_EXPORT static bool isSecure(const URL&); 93 93 94 94 // This method implements the "same origin-domain" algorithm from the HTML Standard: -
trunk/Source/WebCore/platform/network/HTTPParsers.cpp
r280686 r280953 1026 1026 return CrossOriginResourcePolicy::SameSite; 1027 1027 1028 if (strippedHeader == "cross-origin") 1029 return CrossOriginResourcePolicy::CrossOrigin; 1030 1028 1031 return CrossOriginResourcePolicy::Invalid; 1029 1032 } -
trunk/Source/WebCore/platform/network/HTTPParsers.h
r280504 r280953 62 62 }; 63 63 64 enum class CrossOriginResourcePolicy {64 enum class CrossOriginResourcePolicy : uint8_t { 65 65 None, 66 CrossOrigin, 66 67 SameOrigin, 67 68 SameSite, -
trunk/Source/WebCore/workers/Worker.cpp
r278372 r280953 229 229 responseURL.setFragmentIdentifier(m_scriptLoader->url().fragmentIdentifier()); 230 230 } 231 m_contextProxy.startWorkerGlobalScope(responseURL, m_name, context->userAgent(responseURL), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_ workerCreationTime, referrerPolicy, m_type, m_credentials, m_runtimeFlags);231 m_contextProxy.startWorkerGlobalScope(responseURL, m_name, context->userAgent(responseURL), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_scriptLoader->crossOriginEmbedderPolicy(), m_workerCreationTime, referrerPolicy, m_type, m_credentials, m_runtimeFlags); 232 232 InspectorInstrumentation::scriptImported(*context, m_scriptLoader->identifier(), m_scriptLoader->script().toString()); 233 233 } -
trunk/Source/WebCore/workers/WorkerGlobalScope.cpp
r280504 r280953 103 103 setSecurityOriginPolicy(SecurityOriginPolicy::create(WTFMove(origin))); 104 104 setContentSecurityPolicy(makeUnique<ContentSecurityPolicy>(URL { m_url }, *this)); 105 setCrossOriginEmbedderPolicy(params.crossOriginEmbedderPolicy); 105 106 } 106 107 -
trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h
r276384 r280953 52 52 static WorkerGlobalScopeProxy& create(Worker&); 53 53 54 virtual void startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const ScriptBuffer& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, ReferrerPolicy, WorkerType, FetchRequestCredentials, JSC::RuntimeFlags) = 0;54 virtual void startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const ScriptBuffer& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const CrossOriginEmbedderPolicy&, MonotonicTime timeOrigin, ReferrerPolicy, WorkerType, FetchRequestCredentials, JSC::RuntimeFlags) = 0; 55 55 virtual void terminateWorkerGlobalScope() = 0; 56 56 virtual void postMessageToWorkerGlobalScope(MessageWithMessagePorts&&) = 0; -
trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp
r275465 r280953 76 76 } 77 77 78 void WorkerMessagingProxy::startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const ScriptBuffer& sourceCode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, ReferrerPolicy referrerPolicy, WorkerType workerType, FetchRequestCredentials credentials, JSC::RuntimeFlags runtimeFlags)78 void WorkerMessagingProxy::startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const ScriptBuffer& sourceCode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const CrossOriginEmbedderPolicy& crossOriginEmbedderPolicy, MonotonicTime timeOrigin, ReferrerPolicy referrerPolicy, WorkerType workerType, FetchRequestCredentials credentials, JSC::RuntimeFlags runtimeFlags) 79 79 { 80 80 // FIXME: This need to be revisited when we support nested worker one day … … 88 88 SocketProvider* socketProvider = document.socketProvider(); 89 89 90 WorkerParameters params = { scriptURL, name, identifier, userAgent, isOnline, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, timeOrigin, referrerPolicy, workerType, credentials, document.settingsValues() };90 WorkerParameters params = { scriptURL, name, identifier, userAgent, isOnline, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, crossOriginEmbedderPolicy, timeOrigin, referrerPolicy, workerType, credentials, document.settingsValues() }; 91 91 auto thread = DedicatedWorkerThread::create(params, sourceCode, *this, *this, *this, startMode, document.topOrigin(), proxy, socketProvider, runtimeFlags); 92 92 -
trunk/Source/WebCore/workers/WorkerMessagingProxy.h
r275465 r280953 51 51 // Implementations of WorkerGlobalScopeProxy. 52 52 // (Only use these functions in the worker object thread.) 53 void startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const ScriptBuffer& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, ReferrerPolicy, WorkerType, FetchRequestCredentials, JSC::RuntimeFlags) final;53 void startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const ScriptBuffer& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const CrossOriginEmbedderPolicy&, MonotonicTime timeOrigin, ReferrerPolicy, WorkerType, FetchRequestCredentials, JSC::RuntimeFlags) final; 54 54 void terminateWorkerGlobalScope() final; 55 55 void postMessageToWorkerGlobalScope(MessageWithMessagePorts&&) final; -
trunk/Source/WebCore/workers/WorkerScriptLoader.cpp
r279602 r280953 59 59 m_url = url; 60 60 m_destination = FetchOptions::Destination::Script; 61 m_isSecureContext = workerGlobalScope.isSecureContext(); 61 62 62 63 #if ENABLE(SERVICE_WORKER) … … 117 118 m_url = scriptRequest.url(); 118 119 m_destination = fetchOptions.destination; 120 m_isSecureContext = scriptExecutionContext.isSecureContext(); 119 121 120 122 ASSERT(scriptRequest.httpMethod() == "GET"); … … 192 194 m_isRedirected = response.isRedirected(); 193 195 m_contentSecurityPolicy = ContentSecurityPolicyResponseHeaders { response }; 196 m_crossOriginEmbedderPolicy = obtainCrossOriginEmbedderPolicy(response, m_isSecureContext ? IsSecureContext::Yes : IsSecureContext::No); 194 197 m_referrerPolicy = response.httpHeaderField(HTTPHeaderName::ReferrerPolicy); 195 198 if (m_client) -
trunk/Source/WebCore/workers/WorkerScriptLoader.h
r278516 r280953 29 29 #include "CertificateInfo.h" 30 30 #include "ContentSecurityPolicyResponseHeaders.h" 31 #include "CrossOriginEmbedderPolicy.h" 31 32 #include "FetchOptions.h" 32 33 #include "ResourceError.h" … … 67 68 const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy() const { return m_contentSecurityPolicy; } 68 69 const String& referrerPolicy() const { return m_referrerPolicy; } 70 const CrossOriginEmbedderPolicy& crossOriginEmbedderPolicy() const { return m_crossOriginEmbedderPolicy; } 69 71 const URL& url() const { return m_url; } 70 72 const URL& responseURL() const; … … 108 110 ContentSecurityPolicyResponseHeaders m_contentSecurityPolicy; 109 111 String m_referrerPolicy; 112 CrossOriginEmbedderPolicy m_crossOriginEmbedderPolicy; 110 113 unsigned long m_identifier { 0 }; 111 114 bool m_failed { false }; 112 115 bool m_finishing { false }; 113 116 bool m_isRedirected { false }; 117 bool m_isSecureContext { false }; 114 118 ResourceResponse::Source m_responseSource { ResourceResponse::Source::Unknown }; 115 119 ResourceError m_error; -
trunk/Source/WebCore/workers/WorkerThread.cpp
r278253 r280953 56 56 contentSecurityPolicyResponseHeaders, 57 57 shouldBypassMainWorldContentSecurityPolicy, 58 crossOriginEmbedderPolicy.isolatedCopy(), 58 59 timeOrigin, 59 60 referrerPolicy, -
trunk/Source/WebCore/workers/WorkerThread.h
r275465 r280953 27 27 28 28 #include "ContentSecurityPolicyResponseHeaders.h" 29 #include "CrossOriginEmbedderPolicy.h" 29 30 #include "FetchRequestCredentials.h" 30 31 #include "WorkerOrWorkletThread.h" … … 66 67 ContentSecurityPolicyResponseHeaders contentSecurityPolicyResponseHeaders; 67 68 bool shouldBypassMainWorldContentSecurityPolicy; 69 CrossOriginEmbedderPolicy crossOriginEmbedderPolicy; 68 70 MonotonicTime timeOrigin; 69 71 ReferrerPolicy referrerPolicy; -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
r278788 r280953 458 458 } 459 459 460 void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, const ScriptBuffer& script, const CertificateInfo& certificateInfo, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const String& referrerPolicy)460 void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, const ScriptBuffer& script, const CertificateInfo& certificateInfo, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const CrossOriginEmbedderPolicy& coep, const String& referrerPolicy) 461 461 { 462 462 ASSERT(m_creationThread.ptr() == &Thread::current()); … … 464 464 CONTAINER_RELEASE_LOG("jobFinishedLoadingScript: Successfuly finished fetching script for job %" PRIu64, job.identifier().toUInt64()); 465 465 466 ensureSWClientConnection().finishFetchingScriptInServer(ServiceWorkerFetchResult { job.data().identifier(), job.data().registrationKey(), script, certificateInfo, contentSecurityPolicy, referrerPolicy, { } });466 ensureSWClientConnection().finishFetchingScriptInServer(ServiceWorkerFetchResult { job.data().identifier(), job.data().registrationKey(), script, certificateInfo, contentSecurityPolicy, coep, referrerPolicy, { } }); 467 467 } 468 468 -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h
r278788 r280953 101 101 void jobResolvedWithUnregistrationResult(ServiceWorkerJob&, bool unregistrationResult) final; 102 102 void startScriptFetchForJob(ServiceWorkerJob&, FetchOptions::Cache) final; 103 void jobFinishedLoadingScript(ServiceWorkerJob&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const String& referrerPolicy) final;103 void jobFinishedLoadingScript(ServiceWorkerJob&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const CrossOriginEmbedderPolicy&, const String& referrerPolicy) final; 104 104 void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, Exception&&) final; 105 105 -
trunk/Source/WebCore/workers/service/ServiceWorkerContextData.cpp
r279750 r280953 41 41 certificateInfo.isolatedCopy(), 42 42 contentSecurityPolicy.isolatedCopy(), 43 crossOriginEmbedderPolicy.isolatedCopy(), 43 44 referrerPolicy.isolatedCopy(), 44 45 scriptURL.isolatedCopy(), -
trunk/Source/WebCore/workers/service/ServiceWorkerContextData.h
r279750 r280953 28 28 #include "CertificateInfo.h" 29 29 #include "ContentSecurityPolicyResponseHeaders.h" 30 #include "CrossOriginEmbedderPolicy.h" 30 31 #include "ScriptBuffer.h" 31 32 #include "ServiceWorkerIdentifier.h" … … 86 87 CertificateInfo certificateInfo; 87 88 ContentSecurityPolicyResponseHeaders contentSecurityPolicy; 89 CrossOriginEmbedderPolicy crossOriginEmbedderPolicy; 88 90 String referrerPolicy; 89 91 URL scriptURL; … … 102 104 void ServiceWorkerContextData::encode(Encoder& encoder) const 103 105 { 104 encoder << jobDataIdentifier << registration << serviceWorkerIdentifier << script << contentSecurityPolicy << referrerPolicy106 encoder << jobDataIdentifier << registration << serviceWorkerIdentifier << script << contentSecurityPolicy << crossOriginEmbedderPolicy << referrerPolicy 105 107 << scriptURL << workerType << loadedFromDisk << lastNavigationWasAppInitiated << scriptResourceMap << certificateInfo; 106 108 } … … 130 132 ContentSecurityPolicyResponseHeaders contentSecurityPolicy; 131 133 if (!decoder.decode(contentSecurityPolicy)) 134 return std::nullopt; 135 136 std::optional<CrossOriginEmbedderPolicy> crossOriginEmbedderPolicy; 137 decoder >> crossOriginEmbedderPolicy; 138 if (!crossOriginEmbedderPolicy) 132 139 return std::nullopt; 133 140 … … 168 175 WTFMove(*certificateInfo), 169 176 WTFMove(contentSecurityPolicy), 177 WTFMove(*crossOriginEmbedderPolicy), 170 178 WTFMove(referrerPolicy), 171 179 WTFMove(scriptURL), -
trunk/Source/WebCore/workers/service/ServiceWorkerFetchResult.h
r278253 r280953 29 29 30 30 #include "ContentSecurityPolicyResponseHeaders.h" 31 #include "CrossOriginEmbedderPolicy.h" 31 32 #include "ResourceError.h" 32 33 #include "ScriptBuffer.h" … … 42 43 CertificateInfo certificateInfo; 43 44 ContentSecurityPolicyResponseHeaders contentSecurityPolicy; 45 CrossOriginEmbedderPolicy crossOriginEmbedderPolicy; 44 46 String referrerPolicy; 45 47 ResourceError scriptError; 46 48 47 ServiceWorkerFetchResult isolatedCopy() const { return { jobDataIdentifier, registrationKey.isolatedCopy(), script.isolatedCopy(), certificateInfo.isolatedCopy(), contentSecurityPolicy.isolatedCopy(), referrerPolicy.isolatedCopy(), scriptError.isolatedCopy() }; }49 ServiceWorkerFetchResult isolatedCopy() const { return { jobDataIdentifier, registrationKey.isolatedCopy(), script.isolatedCopy(), certificateInfo.isolatedCopy(), contentSecurityPolicy.isolatedCopy(), crossOriginEmbedderPolicy.isolatedCopy(), referrerPolicy.isolatedCopy(), scriptError.isolatedCopy() }; } 48 50 49 51 template<class Encoder> void encode(Encoder&) const; … … 53 55 inline ServiceWorkerFetchResult serviceWorkerFetchError(ServiceWorkerJobDataIdentifier jobDataIdentifier, ServiceWorkerRegistrationKey&& registrationKey, ResourceError&& error) 54 56 { 55 return { jobDataIdentifier, WTFMove(registrationKey), { }, { }, { }, { }, WTFMove(error) };57 return { jobDataIdentifier, WTFMove(registrationKey), { }, { }, { }, { }, { }, WTFMove(error) }; 56 58 } 57 59 … … 59 61 void ServiceWorkerFetchResult::encode(Encoder& encoder) const 60 62 { 61 encoder << jobDataIdentifier << registrationKey << script << contentSecurityPolicy << referrerPolicy << scriptError;63 encoder << jobDataIdentifier << registrationKey << script << contentSecurityPolicy << crossOriginEmbedderPolicy << referrerPolicy << scriptError; 62 64 encoder << certificateInfo; 63 65 } … … 81 83 if (!decoder.decode(result.contentSecurityPolicy)) 82 84 return false; 85 if (!decoder.decode(result.crossOriginEmbedderPolicy)) 86 return false; 83 87 if (!decoder.decode(result.referrerPolicy)) 84 88 return false; -
trunk/Source/WebCore/workers/service/ServiceWorkerJob.cpp
r273299 r280953 166 166 167 167 if (!scriptLoader->failed()) { 168 m_client.jobFinishedLoadingScript(*this, scriptLoader->script(), scriptLoader->certificateInfo(), scriptLoader->contentSecurityPolicy(), scriptLoader-> referrerPolicy());168 m_client.jobFinishedLoadingScript(*this, scriptLoader->script(), scriptLoader->certificateInfo(), scriptLoader->contentSecurityPolicy(), scriptLoader->crossOriginEmbedderPolicy(), scriptLoader->referrerPolicy()); 169 169 return; 170 170 } -
trunk/Source/WebCore/workers/service/ServiceWorkerJobClient.h
r275465 r280953 38 38 class ScriptBuffer; 39 39 class ServiceWorkerJob; 40 struct CrossOriginEmbedderPolicy; 40 41 struct ServiceWorkerRegistrationData; 41 42 … … 50 51 virtual void jobResolvedWithUnregistrationResult(ServiceWorkerJob&, bool unregistrationResult) = 0; 51 52 virtual void startScriptFetchForJob(ServiceWorkerJob&, FetchOptions::Cache) = 0; 52 virtual void jobFinishedLoadingScript(ServiceWorkerJob&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const String& referrerPolicy) = 0;53 virtual void jobFinishedLoadingScript(ServiceWorkerJob&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const CrossOriginEmbedderPolicy&, const String& referrerPolicy) = 0; 53 54 virtual void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, Exception&&) = 0; 54 55 }; -
trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
r278253 r280953 75 75 76 76 ServiceWorkerThread::ServiceWorkerThread(ServiceWorkerContextData&& data, String&& userAgent, const Settings::Values& settingsValues, WorkerLoaderProxy& loaderProxy, WorkerDebuggerProxy& debuggerProxy, IDBClient::IDBConnectionProxy* idbConnectionProxy, SocketProvider* socketProvider) 77 : WorkerThread({ data.scriptURL, emptyString(), "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), platformStrategies()->loaderStrategy()->isOnLine(), data.contentSecurityPolicy, false, MonotonicTime::now(), { }, data.workerType, FetchRequestCredentials::Omit, settingsValues }, data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, data.registration.key.topOrigin().securityOrigin().get(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled())77 : WorkerThread({ data.scriptURL, emptyString(), "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), platformStrategies()->loaderStrategy()->isOnLine(), data.contentSecurityPolicy, false, data.crossOriginEmbedderPolicy, MonotonicTime::now(), { }, data.workerType, FetchRequestCredentials::Omit, settingsValues }, data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, data.registration.key.topOrigin().securityOrigin().get(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled()) 78 78 , m_serviceWorkerIdentifier(data.serviceWorkerIdentifier) 79 79 , m_jobDataIdentifier(data.jobDataIdentifier) -
trunk/Source/WebCore/workers/service/server/RegistrationDatabase.cpp
r279750 r280953 51 51 namespace WebCore { 52 52 53 static const uint64_t schemaVersion = 6;53 static const uint64_t schemaVersion = 7; 54 54 55 55 #define RECORDS_TABLE_SCHEMA_PREFIX "CREATE TABLE " … … 64 64 ", workerType TEXT NOT NULL ON CONFLICT FAIL" \ 65 65 ", contentSecurityPolicy BLOB NOT NULL ON CONFLICT FAIL" \ 66 ", crossOriginEmbedderPolicy BLOB NOT NULL ON CONFLICT FAIL" \ 66 67 ", referrerPolicy TEXT NOT NULL ON CONFLICT FAIL" \ 67 68 ", scriptResourceMap BLOB NOT NULL ON CONFLICT FAIL" \ … … 422 423 transaction.begin(); 423 424 424 auto insertStatement = m_database->prepareStatement("INSERT INTO Records VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"_s);425 auto insertStatement = m_database->prepareStatement("INSERT INTO Records VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"_s); 425 426 if (!insertStatement) { 426 427 RELEASE_LOG_ERROR(ServiceWorker, "Failed to prepare statement to store registration data into records table (%i) - %s", m_database->lastError(), m_database->lastErrorMsg()); … … 443 444 WTF::Persistence::Encoder cspEncoder; 444 445 data.contentSecurityPolicy.encode(cspEncoder); 446 447 WTF::Persistence::Encoder coepEncoder; 448 data.crossOriginEmbedderPolicy.encode(coepEncoder); 445 449 446 450 // We don't actually encode the script sources to the database. They will be stored separately in the ScriptStorage. … … 461 465 || insertStatement->bindText(8, workerTypeToString(data.workerType)) != SQLITE_OK 462 466 || insertStatement->bindBlob(9, Span { cspEncoder.buffer(), cspEncoder.bufferSize() }) != SQLITE_OK 463 || insertStatement->bindText(10, data.referrerPolicy) != SQLITE_OK 464 || insertStatement->bindBlob(11, Span { scriptResourceMapEncoder.buffer(), scriptResourceMapEncoder.bufferSize() }) != SQLITE_OK 465 || insertStatement->bindBlob(12, Span { certificateInfoEncoder.buffer(), certificateInfoEncoder.bufferSize() }) != SQLITE_OK 467 || insertStatement->bindBlob(10, Span { coepEncoder.buffer(), coepEncoder.bufferSize() }) != SQLITE_OK 468 || insertStatement->bindText(11, data.referrerPolicy) != SQLITE_OK 469 || insertStatement->bindBlob(12, Span { scriptResourceMapEncoder.buffer(), scriptResourceMapEncoder.bufferSize() }) != SQLITE_OK 470 || insertStatement->bindBlob(13, Span { certificateInfoEncoder.buffer(), certificateInfoEncoder.bufferSize() }) != SQLITE_OK 466 471 || insertStatement->step() != SQLITE_DONE) { 467 472 RELEASE_LOG_ERROR(ServiceWorker, "Failed to store registration data into records table (%i) - %s", m_database->lastError(), m_database->lastErrorMsg()); … … 526 531 } 527 532 528 auto referrerPolicy = sql->columnText(9); 533 std::optional<CrossOriginEmbedderPolicy> coep; 534 auto coepDataSpan = sql->columnBlobAsSpan(9); 535 if (coepDataSpan.size()) { 536 WTF::Persistence::Decoder coepDecoder(coepDataSpan); 537 coepDecoder >> coep; 538 if (!coep) { 539 RELEASE_LOG_ERROR(ServiceWorker, "RegistrationDatabase::importRecords: Failed to decode crossOriginEmbedderPolicy"); 540 continue; 541 } 542 } 543 544 auto referrerPolicy = sql->columnText(10); 529 545 530 546 HashMap<URL, ServiceWorkerContextData::ImportedScript> scriptResourceMap; 531 auto scriptResourceMapDataSpan = sql->columnBlobAsSpan(1 0);547 auto scriptResourceMapDataSpan = sql->columnBlobAsSpan(11); 532 548 if (scriptResourceMapDataSpan.size()) { 533 549 WTF::Persistence::Decoder scriptResourceMapDecoder(scriptResourceMapDataSpan); … … 541 557 } 542 558 543 auto certificateInfoDataSpan = sql->columnBlobAsSpan(1 1);559 auto certificateInfoDataSpan = sql->columnBlobAsSpan(12); 544 560 std::optional<CertificateInfo> certificateInfo; 545 561 … … 570 586 auto serviceWorkerData = ServiceWorkerData { workerIdentifier, scriptURL, ServiceWorkerState::Activated, *workerType, registrationIdentifier }; 571 587 auto registration = ServiceWorkerRegistrationData { WTFMove(*key), registrationIdentifier, WTFMove(scopeURL), *updateViaCache, lastUpdateCheckTime, std::nullopt, std::nullopt, WTFMove(serviceWorkerData) }; 572 auto contextData = ServiceWorkerContextData { std::nullopt, WTFMove(registration), workerIdentifier, WTFMove(script), WTFMove(*certificateInfo), WTFMove(*contentSecurityPolicy), WTFMove( referrerPolicy), WTFMove(scriptURL), *workerType, true, LastNavigationWasAppInitiated::Yes, WTFMove(scriptResourceMap) };588 auto contextData = ServiceWorkerContextData { std::nullopt, WTFMove(registration), workerIdentifier, WTFMove(script), WTFMove(*certificateInfo), WTFMove(*contentSecurityPolicy), WTFMove(*coep), WTFMove(referrerPolicy), WTFMove(scriptURL), *workerType, true, LastNavigationWasAppInitiated::Yes, WTFMove(scriptResourceMap) }; 573 589 574 590 callOnMainThread([protectedThis = makeRef(*this), contextData = contextData.isolatedCopy()]() mutable { -
trunk/Source/WebCore/workers/service/server/SWServer.cpp
r280319 r280953 170 170 addRegistration(WTFMove(registration)); 171 171 172 auto worker = SWServerWorker::create(*this, *registrationPtr, data.scriptURL, data.script, data.certificateInfo, data.contentSecurityPolicy, WTFMove(data.referrerPolicy), data.workerType, data.serviceWorkerIdentifier, WTFMove(data.scriptResourceMap));172 auto worker = SWServerWorker::create(*this, *registrationPtr, data.scriptURL, data.script, data.certificateInfo, data.contentSecurityPolicy, data.crossOriginEmbedderPolicy, WTFMove(data.referrerPolicy), data.workerType, data.serviceWorkerIdentifier, WTFMove(data.scriptResourceMap)); 173 173 registrationPtr->updateRegistrationState(ServiceWorkerRegistrationState::Active, worker.ptr()); 174 174 worker->setState(ServiceWorkerState::Activated); … … 653 653 } 654 654 655 void SWServer::updateWorker(const ServiceWorkerJobDataIdentifier& jobDataIdentifier, SWServerRegistration& registration, const URL& url, const ScriptBuffer& script, const CertificateInfo& certificateInfo, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const String& referrerPolicy, WorkerType type, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap)656 { 657 tryInstallContextData(ServiceWorkerContextData { jobDataIdentifier, registration.data(), ServiceWorkerIdentifier::generate(), script, certificateInfo, contentSecurityPolicy, referrerPolicy, url, type, false, clientIsAppInitiatedForRegistrableDomain(RegistrableDomain(url)), WTFMove(scriptResourceMap) });655 void SWServer::updateWorker(const ServiceWorkerJobDataIdentifier& jobDataIdentifier, SWServerRegistration& registration, const URL& url, const ScriptBuffer& script, const CertificateInfo& certificateInfo, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const CrossOriginEmbedderPolicy& coep, const String& referrerPolicy, WorkerType type, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap) 656 { 657 tryInstallContextData(ServiceWorkerContextData { jobDataIdentifier, registration.data(), ServiceWorkerIdentifier::generate(), script, certificateInfo, contentSecurityPolicy, coep, referrerPolicy, url, type, false, clientIsAppInitiatedForRegistrableDomain(RegistrableDomain(url)), WTFMove(scriptResourceMap) }); 658 658 } 659 659 … … 720 720 721 721 auto* registration = m_scopeToRegistrationMap.get(data.registration.key).get(); 722 auto worker = SWServerWorker::create(*this, *registration, data.scriptURL, data.script, data.certificateInfo, data.contentSecurityPolicy, String { data.referrerPolicy }, data.workerType, data.serviceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript> { data.scriptResourceMap });722 auto worker = SWServerWorker::create(*this, *registration, data.scriptURL, data.script, data.certificateInfo, data.contentSecurityPolicy, data.crossOriginEmbedderPolicy, String { data.referrerPolicy }, data.workerType, data.serviceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript> { data.scriptResourceMap }); 723 723 724 724 auto* connection = worker->contextConnection(); -
trunk/Source/WebCore/workers/service/server/SWServer.h
r280319 r280953 153 153 void startScriptFetch(const ServiceWorkerJobData&, SWServerRegistration&); 154 154 155 void updateWorker(const ServiceWorkerJobDataIdentifier&, SWServerRegistration&, const URL&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const String& referrerPolicy, WorkerType, HashMap<URL, ServiceWorkerContextData::ImportedScript>&&);155 void updateWorker(const ServiceWorkerJobDataIdentifier&, SWServerRegistration&, const URL&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const CrossOriginEmbedderPolicy&, const String& referrerPolicy, WorkerType, HashMap<URL, ServiceWorkerContextData::ImportedScript>&&); 156 156 void fireInstallEvent(SWServerWorker&); 157 157 void fireActivateEvent(SWServerWorker&); -
trunk/Source/WebCore/workers/service/server/SWServerJobQueue.cpp
r275952 r280953 115 115 // FIXME: Update all the imported scripts as per spec. For now, we just do as if there is none. 116 116 117 m_server.updateWorker(job.identifier(), *registration, job.scriptURL, result.script, result.certificateInfo, result.contentSecurityPolicy, result. referrerPolicy, job.workerType, { });117 m_server.updateWorker(job.identifier(), *registration, job.scriptURL, result.script, result.certificateInfo, result.contentSecurityPolicy, result.crossOriginEmbedderPolicy, result.referrerPolicy, job.workerType, { }); 118 118 } 119 119 -
trunk/Source/WebCore/workers/service/server/SWServerWorker.cpp
r279750 r280953 51 51 52 52 // FIXME: Use r-value references for script and contentSecurityPolicy 53 SWServerWorker::SWServerWorker(SWServer& server, SWServerRegistration& registration, const URL& scriptURL, const ScriptBuffer& script, const CertificateInfo& certificateInfo, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, String&& referrerPolicy, WorkerType type, ServiceWorkerIdentifier identifier, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap)53 SWServerWorker::SWServerWorker(SWServer& server, SWServerRegistration& registration, const URL& scriptURL, const ScriptBuffer& script, const CertificateInfo& certificateInfo, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const CrossOriginEmbedderPolicy& crossOriginEmbedderPolicy, String&& referrerPolicy, WorkerType type, ServiceWorkerIdentifier identifier, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap) 54 54 : m_server(makeWeakPtr(server)) 55 55 , m_registrationKey(registration.key()) … … 59 59 , m_certificateInfo(certificateInfo) 60 60 , m_contentSecurityPolicy(contentSecurityPolicy) 61 , m_crossOriginEmbedderPolicy(crossOriginEmbedderPolicy) 61 62 , m_referrerPolicy(WTFMove(referrerPolicy)) 62 63 , m_registrableDomain(m_data.scriptURL) … … 88 89 ASSERT(m_registration); 89 90 90 return { std::nullopt, m_registration->data(), m_data.identifier, m_script, m_certificateInfo, m_contentSecurityPolicy, m_ referrerPolicy, m_data.scriptURL, m_data.type, false, m_lastNavigationWasAppInitiated, m_scriptResourceMap };91 return { std::nullopt, m_registration->data(), m_data.identifier, m_script, m_certificateInfo, m_contentSecurityPolicy, m_crossOriginEmbedderPolicy, m_referrerPolicy, m_data.scriptURL, m_data.type, false, m_lastNavigationWasAppInitiated, m_scriptResourceMap }; 91 92 } 92 93 -
trunk/Source/WebCore/workers/service/server/SWServerWorker.h
r279750 r280953 30 30 #include "ClientOrigin.h" 31 31 #include "ContentSecurityPolicyResponseHeaders.h" 32 #include "CrossOriginEmbedderPolicy.h" 32 33 #include "RegistrableDomain.h" 33 34 #include "ServiceWorkerClientData.h" … … 131 132 132 133 private: 133 SWServerWorker(SWServer&, SWServerRegistration&, const URL&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, String&& referrerPolicy, WorkerType, ServiceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript>&&);134 SWServerWorker(SWServer&, SWServerRegistration&, const URL&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const CrossOriginEmbedderPolicy&, String&& referrerPolicy, WorkerType, ServiceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript>&&); 134 135 135 136 void callWhenActivatedHandler(bool success); … … 147 148 CertificateInfo m_certificateInfo; 148 149 ContentSecurityPolicyResponseHeaders m_contentSecurityPolicy; 150 CrossOriginEmbedderPolicy m_crossOriginEmbedderPolicy; 149 151 String m_referrerPolicy; 150 152 bool m_hasPendingEvents { false }; -
trunk/Source/WebKit/ChangeLog
r280952 r280953 1 2021-08-11 Chris Dumez <cdumez@apple.com> 2 3 Add initial support for Cross-Origin-Embedder-Policy (COEP) 4 https://bugs.webkit.org/show_bug.cgi?id=228754 5 6 Reviewed by Alex Christensen. 7 8 As mentioned in the WebCore changelog, we do all the COEP checks in the network process 9 instead of WebCore for added security. As a result, we need to pass more information 10 to the network process when doing loads in order to do those checks. The checks are done 11 in NetworkResourceLoader for navigations & worker script loads (similarly to CSP, 12 X-FrameOptions) and in NetworkLoadChecker for CORP checks of subresource loads (similarly 13 to CORS checks). 14 15 * NetworkProcess/NetworkLoadChecker.cpp: 16 (WebKit::NetworkLoadChecker::NetworkLoadChecker): 17 (WebKit::NetworkLoadChecker::validateResponse): 18 * NetworkProcess/NetworkLoadChecker.h: 19 (WebKit::NetworkLoadChecker::setParentCrossOriginEmbedderPolicy): 20 (WebKit::NetworkLoadChecker::setCrossOriginEmbedderPolicy): 21 * NetworkProcess/NetworkResourceLoadParameters.cpp: 22 (WebKit::NetworkResourceLoadParameters::parentOrigin const): 23 (WebKit::NetworkResourceLoadParameters::encode const): 24 (WebKit::NetworkResourceLoadParameters::decode): 25 * NetworkProcess/NetworkResourceLoadParameters.h: 26 * NetworkProcess/NetworkResourceLoader.cpp: 27 (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): 28 (WebKit::NetworkResourceLoader::shouldInterruptNavigationForCrossOriginEmbedderPolicy): 29 (WebKit::NetworkResourceLoader::shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy): 30 (WebKit::NetworkResourceLoader::didReceiveResponse): 31 (WebKit::NetworkResourceLoader::willSendRedirectedRequest): 32 * NetworkProcess/NetworkResourceLoader.h: 33 * NetworkProcess/PingLoad.cpp: 34 (WebKit::PingLoad::PingLoad): 35 (WebKit::PingLoad::initialize): 36 * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: 37 (WebKit::ServiceWorkerFetchTask::didReceiveResponse): 38 * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: 39 (WebKit::ServiceWorkerSoftUpdateLoader::processResponse): 40 (WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading): 41 * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: 42 * NetworkProcess/cache/CacheStorageEngineCache.cpp: 43 (WebKit::CacheStorage::Cache::retrieveRecords): 44 * WebProcess/Network/WebLoaderStrategy.cpp: 45 (WebKit::addParametersShared): 46 (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): 47 1 48 2021-08-11 Darin Adler <darin@apple.com> 2 49 -
trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp
r278953 r280953 51 51 } 52 52 53 NetworkLoadChecker::NetworkLoadChecker(NetworkProcess& networkProcess, NetworkResourceLoader* networkResourceLoader, NetworkSchemeRegistry* schemeRegistry, FetchOptions&& options, PAL::SessionID sessionID, WebPageProxyIdentifier webPageProxyID, HTTPHeaderMap&& originalRequestHeaders, URL&& url, DocumentURL&& documentURL, RefPtr<SecurityOrigin>&& sourceOrigin, RefPtr<SecurityOrigin>&& topOrigin, PreflightPolicy preflightPolicy, String&& referrer, bool shouldCaptureExtraNetworkLoadMetrics, LoadType requestLoadType)53 NetworkLoadChecker::NetworkLoadChecker(NetworkProcess& networkProcess, NetworkResourceLoader* networkResourceLoader, NetworkSchemeRegistry* schemeRegistry, FetchOptions&& options, PAL::SessionID sessionID, WebPageProxyIdentifier webPageProxyID, HTTPHeaderMap&& originalRequestHeaders, URL&& url, DocumentURL&& documentURL, RefPtr<SecurityOrigin>&& sourceOrigin, RefPtr<SecurityOrigin>&& topOrigin, RefPtr<SecurityOrigin>&& parentOrigin, PreflightPolicy preflightPolicy, String&& referrer, bool shouldCaptureExtraNetworkLoadMetrics, LoadType requestLoadType) 54 54 : m_options(WTFMove(options)) 55 55 , m_sessionID(sessionID) … … 61 61 , m_origin(WTFMove(sourceOrigin)) 62 62 , m_topOrigin(WTFMove(topOrigin)) 63 , m_parentOrigin(WTFMove(parentOrigin)) 63 64 , m_preflightPolicy(preflightPolicy) 64 65 , m_referrer(WTFMove(referrer)) … … 169 170 170 171 if (m_options.mode == FetchOptions::Mode::Navigate || m_isSameOriginRequest) { 172 if (m_options.mode == FetchOptions::Mode::Navigate && m_parentOrigin) { 173 if (auto error = validateCrossOriginResourcePolicy(m_parentCrossOriginEmbedderPolicy.value, *m_parentOrigin, m_url, response, ForNavigation::Yes)) 174 return WTFMove(*error); 175 } 171 176 response.setTainting(ResourceResponse::Tainting::Basic); 172 177 return { }; … … 177 182 178 183 if (m_options.mode == FetchOptions::Mode::NoCors) { 179 if (auto error = validateCrossOriginResourcePolicy( *m_origin, m_url, response))184 if (auto error = validateCrossOriginResourcePolicy(m_crossOriginEmbedderPolicy.value, *m_origin, m_url, response, ForNavigation::No)) 180 185 return WTFMove(*error); 181 186 -
trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h
r278253 r280953 30 30 #include <WebCore/ContentExtensionActions.h> 31 31 #include <WebCore/ContentSecurityPolicyResponseHeaders.h> 32 #include <WebCore/CrossOriginEmbedderPolicy.h> 32 33 #include <WebCore/FetchOptions.h> 33 34 #include <WebCore/NetworkLoadInformation.h> … … 61 62 enum class LoadType : bool { MainFrame, Other }; 62 63 63 NetworkLoadChecker(NetworkProcess&, NetworkResourceLoader*, NetworkSchemeRegistry*, WebCore::FetchOptions&&, PAL::SessionID, WebPageProxyIdentifier, WebCore::HTTPHeaderMap&&, URL&&, DocumentURL&&, RefPtr<WebCore::SecurityOrigin>&&, RefPtr<WebCore::SecurityOrigin>&& topOrigin, WebCore::PreflightPolicy, String&& referrer, bool shouldCaptureExtraNetworkLoadMetrics = false, LoadType requestLoadType = LoadType::Other);64 NetworkLoadChecker(NetworkProcess&, NetworkResourceLoader*, NetworkSchemeRegistry*, WebCore::FetchOptions&&, PAL::SessionID, WebPageProxyIdentifier, WebCore::HTTPHeaderMap&&, URL&&, DocumentURL&&, RefPtr<WebCore::SecurityOrigin>&&, RefPtr<WebCore::SecurityOrigin>&& topOrigin, RefPtr<WebCore::SecurityOrigin>&& parentOrigin, WebCore::PreflightPolicy, String&& referrer, bool shouldCaptureExtraNetworkLoadMetrics = false, LoadType requestLoadType = LoadType::Other); 64 65 ~NetworkLoadChecker(); 65 66 … … 81 82 82 83 void setCSPResponseHeaders(WebCore::ContentSecurityPolicyResponseHeaders&& headers) { m_cspResponseHeaders = WTFMove(headers); } 84 void setParentCrossOriginEmbedderPolicy(const WebCore::CrossOriginEmbedderPolicy& parentCrossOriginEmbedderPolicy) { m_parentCrossOriginEmbedderPolicy = parentCrossOriginEmbedderPolicy; } 85 void setCrossOriginEmbedderPolicy(const WebCore::CrossOriginEmbedderPolicy& crossOriginEmbedderPolicy) { m_crossOriginEmbedderPolicy = crossOriginEmbedderPolicy; } 83 86 #if ENABLE(CONTENT_EXTENSIONS) 84 87 void setContentExtensionController(URL&& mainDocumentURL, std::optional<UserContentControllerIdentifier> identifier) … … 139 142 RefPtr<WebCore::SecurityOrigin> m_origin; 140 143 RefPtr<WebCore::SecurityOrigin> m_topOrigin; 144 RefPtr<WebCore::SecurityOrigin> m_parentOrigin; 141 145 std::optional<WebCore::ContentSecurityPolicyResponseHeaders> m_cspResponseHeaders; 146 WebCore::CrossOriginEmbedderPolicy m_parentCrossOriginEmbedderPolicy; 147 WebCore::CrossOriginEmbedderPolicy m_crossOriginEmbedderPolicy; 142 148 #if ENABLE(CONTENT_EXTENSIONS) 143 149 URL m_mainDocumentURL; -
trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.cpp
r278253 r280953 32 32 using namespace WebCore; 33 33 34 RefPtr<SecurityOrigin> NetworkResourceLoadParameters::parentOrigin() const 35 { 36 if (frameAncestorOrigins.isEmpty()) 37 return nullptr; 38 return frameAncestorOrigins.first(); 39 } 40 34 41 void NetworkResourceLoadParameters::encode(IPC::Encoder& encoder) const 35 42 { … … 97 104 encoder << options; 98 105 encoder << cspResponseHeaders; 106 encoder << parentCrossOriginEmbedderPolicy; 107 encoder << crossOriginEmbedderPolicy; 99 108 encoder << originalRequestHeaders; 100 109 … … 232 241 if (!decoder.decode(result.cspResponseHeaders)) 233 242 return std::nullopt; 243 244 std::optional<WebCore::CrossOriginEmbedderPolicy> parentCrossOriginEmbedderPolicy; 245 decoder >> parentCrossOriginEmbedderPolicy; 246 if (!parentCrossOriginEmbedderPolicy) 247 return std::nullopt; 248 result.parentCrossOriginEmbedderPolicy = WTFMove(*parentCrossOriginEmbedderPolicy); 249 250 std::optional<WebCore::CrossOriginEmbedderPolicy> crossOriginEmbedderPolicy; 251 decoder >> crossOriginEmbedderPolicy; 252 if (!crossOriginEmbedderPolicy) 253 return std::nullopt; 254 result.crossOriginEmbedderPolicy = WTFMove(*crossOriginEmbedderPolicy); 255 234 256 if (!decoder.decode(result.originalRequestHeaders)) 235 257 return std::nullopt; -
trunk/Source/WebKit/NetworkProcess/NetworkResourceLoadParameters.h
r278738 r280953 32 32 #include <WebCore/ContentSecurityPolicyResponseHeaders.h> 33 33 #include <WebCore/CrossOriginAccessControl.h> 34 #include <WebCore/CrossOriginEmbedderPolicy.h> 34 35 #include <WebCore/FetchOptions.h> 35 36 #include <wtf/Seconds.h> … … 49 50 static std::optional<NetworkResourceLoadParameters> decode(IPC::Decoder&); 50 51 52 RefPtr<WebCore::SecurityOrigin> parentOrigin() const; 53 51 54 ResourceLoadIdentifier identifier { 0 }; 52 55 Vector<RefPtr<SandboxExtension>> requestBodySandboxExtensions; // Created automatically for the sender. … … 55 58 WebCore::FetchOptions options; 56 59 std::optional<WebCore::ContentSecurityPolicyResponseHeaders> cspResponseHeaders; 60 WebCore::CrossOriginEmbedderPolicy parentCrossOriginEmbedderPolicy; 61 WebCore::CrossOriginEmbedderPolicy crossOriginEmbedderPolicy; 57 62 WebCore::HTTPHeaderMap originalRequestHeaders; 58 63 bool shouldRestrictHTTPResponseAccess { false }; -
trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
r279750 r280953 121 121 if (synchronousReply || parameters.shouldRestrictHTTPResponseAccess || parameters.options.keepAlive) { 122 122 NetworkLoadChecker::LoadType requestLoadType = isMainFrameLoad() ? NetworkLoadChecker::LoadType::MainFrame : NetworkLoadChecker::LoadType::Other; 123 m_networkLoadChecker = makeUnique<NetworkLoadChecker>(connection.networkProcess(), this, &connection.schemeRegistry(), FetchOptions { m_parameters.options }, sessionID(), m_parameters.webPageProxyID, HTTPHeaderMap { m_parameters.originalRequestHeaders }, URL { m_parameters.request.url() }, URL { m_parameters.documentURL }, m_parameters.sourceOrigin.copyRef(), m_parameters.topOrigin.copyRef(), m_parameters.p reflightPolicy, originalRequest().httpReferrer(), shouldCaptureExtraNetworkLoadMetrics(), requestLoadType);123 m_networkLoadChecker = makeUnique<NetworkLoadChecker>(connection.networkProcess(), this, &connection.schemeRegistry(), FetchOptions { m_parameters.options }, sessionID(), m_parameters.webPageProxyID, HTTPHeaderMap { m_parameters.originalRequestHeaders }, URL { m_parameters.request.url() }, URL { m_parameters.documentURL }, m_parameters.sourceOrigin.copyRef(), m_parameters.topOrigin.copyRef(), m_parameters.parentOrigin(), m_parameters.preflightPolicy, originalRequest().httpReferrer(), shouldCaptureExtraNetworkLoadMetrics(), requestLoadType); 124 124 if (m_parameters.cspResponseHeaders) 125 125 m_networkLoadChecker->setCSPResponseHeaders(ContentSecurityPolicyResponseHeaders { m_parameters.cspResponseHeaders.value() }); 126 m_networkLoadChecker->setParentCrossOriginEmbedderPolicy(m_parameters.parentCrossOriginEmbedderPolicy); 127 m_networkLoadChecker->setCrossOriginEmbedderPolicy(m_parameters.crossOriginEmbedderPolicy); 126 128 #if ENABLE(CONTENT_EXTENSIONS) 127 129 m_networkLoadChecker->setContentExtensionController(URL { m_parameters.mainDocumentURL }, m_parameters.userContentControllerIdentifier); … … 576 578 String xFrameOptions = m_response.httpHeaderField(HTTPHeaderName::XFrameOptions); 577 579 if (!xFrameOptions.isNull() && shouldInterruptLoadForXFrameOptions(xFrameOptions, response.url())) { 578 String errorMessage = "Refused to display '" + response.url().stringCenterEllipsizedToLength() + "' in a frame because it set 'X-Frame-Options' to '" + xFrameOptions + "'."; 580 String errorMessage = makeString("Refused to display '", response.url().stringCenterEllipsizedToLength(), "' in a frame because it set 'X-Frame-Options' to '", xFrameOptions, "'."); 581 send(Messages::WebPage::AddConsoleMessage { m_parameters.webFrameID, MessageSource::Security, MessageLevel::Error, errorMessage, identifier() }, m_parameters.webPageID); 582 return true; 583 } 584 } 585 586 return shouldInterruptNavigationForCrossOriginEmbedderPolicy(m_response); 587 } 588 589 bool NetworkResourceLoader::shouldInterruptNavigationForCrossOriginEmbedderPolicy(const ResourceResponse& response) 590 { 591 ASSERT(isMainResource()); 592 593 // https://html.spec.whatwg.org/multipage/origin.html#check-a-navigation-response's-adherence-to-its-embedder-policy 594 if (m_parameters.parentCrossOriginEmbedderPolicy.value != WebCore::CrossOriginEmbedderPolicyValue::UnsafeNone && m_parameters.sourceOrigin) { 595 auto responseCOEP = WebCore::obtainCrossOriginEmbedderPolicy(response, m_parameters.sourceOrigin->isPotentiallyTrustworthy() ? IsSecureContext::Yes : IsSecureContext::No); 596 if (responseCOEP.value != WebCore::CrossOriginEmbedderPolicyValue::RequireCORP) { 597 String errorMessage = makeString("Refused to display '", response.url().stringCenterEllipsizedToLength(), "' in a frame because of Cross-Origin-Embedder-Policy."); 598 send(Messages::WebPage::AddConsoleMessage { m_parameters.webFrameID, MessageSource::Security, MessageLevel::Error, errorMessage, identifier() }, m_parameters.webPageID); 599 return true; 600 } 601 } 602 return false; 603 } 604 605 bool NetworkResourceLoader::shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy(const ResourceResponse& response) 606 { 607 if (m_parameters.options.destination != FetchOptions::Destination::Worker) 608 return false; 609 610 if (m_parameters.crossOriginEmbedderPolicy.value != WebCore::CrossOriginEmbedderPolicyValue::UnsafeNone && m_parameters.sourceOrigin) { 611 auto responseCOEP = WebCore::obtainCrossOriginEmbedderPolicy(response, m_parameters.sourceOrigin->isPotentiallyTrustworthy() ? IsSecureContext::Yes : IsSecureContext::No); 612 if (responseCOEP.value != WebCore::CrossOriginEmbedderPolicyValue::RequireCORP) { 613 String errorMessage = makeString("Refused to load '", response.url().stringCenterEllipsizedToLength(), "' worker because of Cross-Origin-Embedder-Policy."); 579 614 send(Messages::WebPage::AddConsoleMessage { m_parameters.webFrameID, MessageSource::Security, MessageLevel::Error, errorMessage, identifier() }, m_parameters.webPageID); 580 615 return true; … … 624 659 auto response = sanitizeResponseIfPossible(ResourceResponse { m_response }, ResourceResponse::SanitizationType::CrossOriginSafe); 625 660 send(Messages::WebResourceLoader::StopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied { response }); 661 return completionHandler(PolicyAction::Ignore); 662 } 663 664 // https://html.spec.whatwg.org/multipage/origin.html#check-a-global-object's-embedder-policy 665 if (shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy(m_response)) { 666 LOADER_RELEASE_LOG_ERROR("didReceiveResponse: Interrupting worker load due to Cross-Origin-Opener-Policy"); 667 RunLoop::main().dispatch([protectedThis = makeRef(*this), url = m_response.url()] { 668 if (protectedThis->m_networkLoad) 669 protectedThis->didFailLoading(ResourceError { errorDomainWebKitInternal, 0, url, "Worker load was blocked by Cross-Origin-Embedder-Policy"_s, ResourceError::Type::AccessControl }); 670 }); 626 671 return completionHandler(PolicyAction::Ignore); 627 672 } … … 834 879 if (redirectResponse.source() == ResourceResponse::Source::Network && canUseCachedRedirect(request)) 835 880 m_cache->storeRedirect(request, redirectResponse, redirectRequest, maxAgeCap); 881 882 if (isMainResource() && shouldInterruptNavigationForCrossOriginEmbedderPolicy(redirectResponse)) { 883 this->didFailLoading(ResourceError { errorDomainWebKitInternal, 0, redirectRequest.url(), "Redirection was blocked by Cross-Origin-Embedder-Policy"_s, ResourceError::Type::AccessControl }); 884 return; 885 } 836 886 837 887 if (m_networkLoadChecker) { -
trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.h
r279750 r280953 164 164 bool shouldInterruptLoadForXFrameOptions(const String&, const URL&); 165 165 bool shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions(const WebCore::ResourceResponse&); 166 bool shouldInterruptNavigationForCrossOriginEmbedderPolicy(const WebCore::ResourceResponse&); 167 bool shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy(const WebCore::ResourceResponse&); 166 168 167 169 enum class FirstLoad { No, Yes }; -
trunk/Source/WebKit/NetworkProcess/PingLoad.cpp
r278953 r280953 46 46 , m_completionHandler(WTFMove(completionHandler)) 47 47 , m_timeoutTimer(*this, &PingLoad::timeoutTimerFired) 48 , m_networkLoadChecker(makeUniqueRef<NetworkLoadChecker>(networkProcess, nullptr, nullptr, FetchOptions { m_parameters.options}, m_sessionID, m_parameters.webPageProxyID, WTFMove(m_parameters.originalRequestHeaders), URL { m_parameters.request.url() }, URL { m_parameters.documentURL }, m_parameters.sourceOrigin.copyRef(), m_parameters.topOrigin.copyRef(), m_parameters.p reflightPolicy, m_parameters.request.httpReferrer()))48 , m_networkLoadChecker(makeUniqueRef<NetworkLoadChecker>(networkProcess, nullptr, nullptr, FetchOptions { m_parameters.options}, m_sessionID, m_parameters.webPageProxyID, WTFMove(m_parameters.originalRequestHeaders), URL { m_parameters.request.url() }, URL { m_parameters.documentURL }, m_parameters.sourceOrigin.copyRef(), m_parameters.topOrigin.copyRef(), m_parameters.parentOrigin(), m_parameters.preflightPolicy, m_parameters.request.httpReferrer())) 49 49 { 50 50 initialize(networkProcess); … … 56 56 , m_completionHandler(WTFMove(completionHandler)) 57 57 , m_timeoutTimer(*this, &PingLoad::timeoutTimerFired) 58 , m_networkLoadChecker(makeUniqueRef<NetworkLoadChecker>(connection.networkProcess(), nullptr, &connection.schemeRegistry(), FetchOptions { m_parameters.options}, m_sessionID, m_parameters.webPageProxyID, WTFMove(m_parameters.originalRequestHeaders), URL { m_parameters.request.url() }, URL { m_parameters.documentURL }, m_parameters.sourceOrigin.copyRef(), m_parameters.topOrigin.copyRef(), m_parameters.p reflightPolicy, m_parameters.request.httpReferrer()))58 , m_networkLoadChecker(makeUniqueRef<NetworkLoadChecker>(connection.networkProcess(), nullptr, &connection.schemeRegistry(), FetchOptions { m_parameters.options}, m_sessionID, m_parameters.webPageProxyID, WTFMove(m_parameters.originalRequestHeaders), URL { m_parameters.request.url() }, URL { m_parameters.documentURL }, m_parameters.sourceOrigin.copyRef(), m_parameters.topOrigin.copyRef(), m_parameters.parentOrigin(), m_parameters.preflightPolicy, m_parameters.request.httpReferrer())) 59 59 , m_blobFiles(connection.resolveBlobReferences(m_parameters)) 60 60 { … … 72 72 if (m_parameters.cspResponseHeaders) 73 73 m_networkLoadChecker->setCSPResponseHeaders(WTFMove(m_parameters.cspResponseHeaders.value())); 74 m_networkLoadChecker->setParentCrossOriginEmbedderPolicy(m_parameters.parentCrossOriginEmbedderPolicy); 75 m_networkLoadChecker->setCrossOriginEmbedderPolicy(m_parameters.crossOriginEmbedderPolicy); 74 76 #if ENABLE(CONTENT_EXTENSIONS) 75 77 m_networkLoadChecker->setContentExtensionController(WTFMove(m_parameters.mainDocumentURL), m_parameters.userContentControllerIdentifier); -
trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp
r279750 r280953 146 146 softUpdateIfNeeded(); 147 147 148 if (m_loader.parameters().options.mode == FetchOptions::Mode::Navigate) { 149 if (auto parentOrigin = m_loader.parameters().parentOrigin()) { 150 if (auto error = validateCrossOriginResourcePolicy(m_loader.parameters().parentCrossOriginEmbedderPolicy.value, *parentOrigin, m_currentRequest.url(), response, ForNavigation::Yes)) { 151 didFail(*error); 152 return; 153 } 154 } 155 } 156 if (m_loader.parameters().options.mode == FetchOptions::Mode::NoCors) { 157 if (auto error = validateCrossOriginResourcePolicy(m_loader.parameters().crossOriginEmbedderPolicy.value, *m_loader.parameters().sourceOrigin, m_currentRequest.url(), response, ForNavigation::No)) { 158 didFail(*error); 159 return; 160 } 161 } 162 148 163 response.setSource(ResourceResponse::Source::ServiceWorker); 149 164 sendToClient(Messages::WebResourceLoader::DidReceiveResponse { response, needsContinueDidReceiveResponseMessage }); -
trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp
r279750 r280953 170 170 171 171 m_contentSecurityPolicy = ContentSecurityPolicyResponseHeaders { response }; 172 // Service workers are always secure contexts. 173 m_crossOriginEmbedderPolicy = obtainCrossOriginEmbedderPolicy(response, IsSecureContext::Yes); 172 174 m_referrerPolicy = response.httpHeaderField(HTTPHeaderName::ReferrerPolicy); 173 175 m_responseEncoding = response.textEncodingName(); … … 193 195 if (m_decoder) 194 196 m_script.append(m_decoder->flush()); 195 m_completionHandler({ m_jobData.identifier(), m_jobData.registrationKey(), ScriptBuffer { m_script.toString() }, m_certificateInfo, m_contentSecurityPolicy, m_ referrerPolicy, { } });197 m_completionHandler({ m_jobData.identifier(), m_jobData.registrationKey(), ScriptBuffer { m_script.toString() }, m_certificateInfo, m_contentSecurityPolicy, m_crossOriginEmbedderPolicy, m_referrerPolicy, { } }); 196 198 didComplete(); 197 199 } -
trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h
r264724 r280953 31 31 #include "NetworkLoadClient.h" 32 32 #include <WebCore/ContentSecurityPolicyResponseHeaders.h> 33 #include <WebCore/CrossOriginEmbedderPolicy.h> 33 34 #include <WebCore/FetchOptions.h> 34 35 #include <WebCore/ServiceWorkerJobData.h> … … 82 83 String m_referrerPolicy; 83 84 WebCore::ContentSecurityPolicyResponseHeaders m_contentSecurityPolicy; 85 WebCore::CrossOriginEmbedderPolicy m_crossOriginEmbedderPolicy; 84 86 85 87 std::unique_ptr<NetworkCache::Entry> m_cacheEntry; -
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp
r279645 r280953 34 34 #include "WebCoreArgumentCoders.h" 35 35 #include <WebCore/CacheQueryOptions.h> 36 #include <WebCore/CrossOriginAccessControl.h> 36 37 #include <WebCore/HTTPParsers.h> 37 38 #include <WebCore/RetrieveRecordsOptions.h> … … 287 288 ASSERT(m_state == State::Open); 288 289 289 auto taskCounter = ReadRecordTaskCounter::create([caches = makeRef(m_caches), identifier = m_identifier, shouldProvideResponse = options.shouldProvideResponse, callback = WTFMove(callback)](Vector<Record>&& records, Vector<uint64_t>&& failedRecordIdentifiers) mutable {290 auto taskCounter = ReadRecordTaskCounter::create([caches = makeRef(m_caches), identifier = m_identifier, options, callback = WTFMove(callback)](Vector<Record>&& records, Vector<uint64_t>&& failedRecordIdentifiers) mutable { 290 291 auto* cache = caches->find(identifier); 291 292 if (cache) 292 293 cache->removeFromRecordList(failedRecordIdentifiers); 293 294 294 if (!shouldProvideResponse) { 295 // https://w3c.github.io/ServiceWorker/#dom-cache-matchall (Step 5.4) 296 for (auto& record : records) { 297 if (record.response.type() != ResourceResponse::Type::Opaque) 298 continue; 299 300 if (validateCrossOriginResourcePolicy(options.crossOriginEmbedderPolicy.value, options.sourceOrigin, record.request.url(), record.response, ForNavigation::No)) { 301 callback(makeUnexpected(DOMCacheEngine::Error::CORP)); 302 return; 303 } 304 } 305 306 if (!options.shouldProvideResponse) { 295 307 for (auto& record : records) { 296 308 record.response = { }; -
trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
r280014 r280953 277 277 return; 278 278 279 if (auto* document = frame->document()) 280 parameters.crossOriginEmbedderPolicy = document->crossOriginEmbedderPolicy(); 281 279 282 if (auto* page = frame->page()) { 280 283 parameters.pageHasResourceLoadClient = page->hasResourceLoadClient(); … … 284 287 285 288 if (auto* ownerElement = frame->ownerElement()) { 286 if (auto* parentFrame = ownerElement->document().frame()) 289 if (auto* parentFrame = ownerElement->document().frame()) { 287 290 parameters.parentFrameID = parentFrame->loader().frameID(); 291 parameters.parentCrossOriginEmbedderPolicy = ownerElement->document().crossOriginEmbedderPolicy(); 292 } 288 293 } 289 294 } … … 337 342 loadParameters.cspResponseHeaders = contentSecurityPolicy->responseHeaders(); 338 343 } 344 345 if (resourceLoader.options().crossOriginEmbedderPolicy) 346 loadParameters.crossOriginEmbedderPolicy = *resourceLoader.options().crossOriginEmbedderPolicy; 339 347 340 348 #if ENABLE(APP_BOUND_DOMAINS) || ENABLE(CONTENT_EXTENSIONS) -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm
r278590 r280953 1944 1944 1945 1945 NSURL* directory = [NSURL fileURLWithPath:path isDirectory:YES]; 1946 NSURL *swDBPath = [directory URLByAppendingPathComponent:@"ServiceWorkerRegistrations- 6.sqlite3"];1946 NSURL *swDBPath = [directory URLByAppendingPathComponent:@"ServiceWorkerRegistrations-7.sqlite3"]; 1947 1947 1948 1948 EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:swDBPath.path]); … … 1971 1971 1972 1972 [[NSFileManager defaultManager] createDirectoryAtURL:swPath withIntermediateDirectories:YES attributes:nil error:nil]; 1973 [[NSFileManager defaultManager] copyItemAtURL:url1 toURL:[swPath URLByAppendingPathComponent:@"ServiceWorkerRegistrations- 6.sqlite3"] error:nil];1973 [[NSFileManager defaultManager] copyItemAtURL:url1 toURL:[swPath URLByAppendingPathComponent:@"ServiceWorkerRegistrations-7.sqlite3"] error:nil]; 1974 1974 1975 1975 auto websiteDataStoreConfiguration = adoptNS([[_WKWebsiteDataStoreConfiguration alloc] init]); … … 2380 2380 2381 2381 unsigned timeout = 0; 2382 while (![[NSFileManager defaultManager] fileExistsAtPath:[swPath URLByAppendingPathComponent:@"ServiceWorkerRegistrations- 6.sqlite3"].path] && ++timeout < 20)2382 while (![[NSFileManager defaultManager] fileExistsAtPath:[swPath URLByAppendingPathComponent:@"ServiceWorkerRegistrations-7.sqlite3"].path] && ++timeout < 20) 2383 2383 TestWebKitAPI::Util::sleep(0.1); 2384 EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:[swPath URLByAppendingPathComponent:@"ServiceWorkerRegistrations- 6.sqlite3"].path]);2384 EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:[swPath URLByAppendingPathComponent:@"ServiceWorkerRegistrations-7.sqlite3"].path]); 2385 2385 2386 2386 // Fetch SW records
Note: See TracChangeset
for help on using the changeset viewer.