Commit e87490d6 authored by Eriko Kurimoto's avatar Eriko Kurimoto Committed by Commit Bot

SharedWorker: Inherit outside settings CSP when top-level script is data url

This CL lets SharedWorkerGlobalScope inherit outside settings CSP when
response url's scheme is a local scheme.
This behavior is defined here:

If response’s url’s scheme is a local scheme, or if global is a
DedicatedWorkerGlobalScope: ...
- Insert a copy of policy into global’s CSP list.
https://w3c.github.io/webappsec-csp/#initialize-global-object-csp

Bug: 1056161
Change-Id: I2a41a91bf021f5dda55303dece0d49163dc7c822
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2082855
Commit-Queue: Eriko Kurimoto <elkurin@google.com>
Reviewed-by: default avatarHiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747614}
parent 2756923f
...@@ -95,9 +95,21 @@ void SharedWorkerGlobalScope::Initialize( ...@@ -95,9 +95,21 @@ void SharedWorkerGlobalScope::Initialize(
// Step 12.6. "Execute the Initialize a global object's CSP list algorithm // Step 12.6. "Execute the Initialize a global object's CSP list algorithm
// on worker global scope and response. [CSP]" // on worker global scope and response. [CSP]"
// SharedWorkerGlobalScope inherits the outside's CSP instead of the response
// CSP headers when the response's url's scheme is a local scheme. Otherwise,
// use the response CSP headers. Here a local scheme is defined as follows:
// "A local scheme is a scheme that is "about", "blob", or "data"."
// https://fetch.spec.whatwg.org/#local-scheme
//
// https://w3c.github.io/webappsec-csp/#initialize-global-object-csp
// These should be called after SetAddressSpace() to correctly override the // These should be called after SetAddressSpace() to correctly override the
// address space by the "treat-as-public-address" CSP directive. // address space by the "treat-as-public-address" CSP directive.
InitContentSecurityPolicyFromVector(response_csp_headers); Vector<CSPHeaderAndType> csp_headers =
response_url.ProtocolIsAbout() || response_url.ProtocolIsData() ||
response_url.ProtocolIs("blob")
? OutsideContentSecurityPolicyHeaders()
: response_csp_headers;
InitContentSecurityPolicyFromVector(csp_headers);
BindContentSecurityPolicyToExecutionContext(); BindContentSecurityPolicyToExecutionContext();
OriginTrialContext::AddTokens(this, response_origin_trial_tokens); OriginTrialContext::AddTokens(this, response_origin_trial_tokens);
......
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-http origin and keep-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-http origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-https origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-http origin and keep-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-http origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-https origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for websocket to cross-ws origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for websocket to same-ws origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-http origin and keep-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-http origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-https origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-http origin and keep-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-http origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-https origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for websocket to cross-ws origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for websocket to same-ws origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-http origin and keep-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-http origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-https origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-http origin and keep-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-http origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-https origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for websocket to cross-ws origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for websocket to same-ws origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-http origin and keep-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-http origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-https origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-http origin and keep-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-http origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-https origin and swap-scheme redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to cross-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for fetch to same-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for websocket to cross-ws origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for websocket to same-ws origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to cross-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL Mixed-Content: Expects blocked for xhr to same-http origin and no-redirect redirection from https context. assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment