Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Un-deprecated child-src #313

Merged
merged 2 commits into from
Jul 10, 2018
Merged

Un-deprecated child-src #313

merged 2 commits into from
Jul 10, 2018

Conversation

andypaicu
Copy link
Collaborator

@andypaicu andypaicu commented Jun 6, 2018

@andypaicu andypaicu requested a review from mikewest June 6, 2018 14:33
Copy link
Member

@mikewest mikewest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Small questions...

Also, do we have tests for this? Does Firefox pass them? (Does Chrome?)

if not present (which likewise defers to `default-src` in turn).
2. A `worker-src` directive has been added, deferring to `child-src`
if not present (which likewise defers to `script-src` and
eventually `default-src`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really explain to me what the chain is. Did we end up with worker-src -> script-src -> child-src -> default-src? It would be helpful to spell the inheritance out more clearly. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inheritance we ended up going with is worker-src -> child-src -> script-src -> default-src.

@@ -1889,7 +1884,7 @@ <h5 algorithm id="child-src-post-request">
1. Let |name| be the result of executing
[[#effective-directive-for-a-request]] on |request|.

2. If |name| is not `frame-src`, return "`Allowed`".
2. If |name| is not `frame-src` or `worker-src`, return "`Allowed`".

3. If |policy| contains a directive whose <a for="directive">name</a>
is |name|, return "`Allowed`"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to check for script-src somewhere in here as well, right? Just as you do below in default-src?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Also in the pre-check)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the chain is the other way around. I check for the presence of child-src in script-src.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm. Ok. And you'll presumably extend that to check for script-whatever in an upcoming patch?

Copy link
Member

@mikewest mikewest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. In that case, LGTM. Land it once we have tests. :)

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 6, 2018
'child-src' is now part of the fallback chain for 'worker-src'.
This means that if 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not brake "child-src" using sites.

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 9, 2018
'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 9, 2018
'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
aarongable pushed a commit to chromium/chromium that referenced this pull request Jul 9, 2018
'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
Reviewed-on: https://chromium-review.googlesource.com/1128087
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573278}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 9, 2018
'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
Reviewed-on: https://chromium-review.googlesource.com/1128087
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573278}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 9, 2018
'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
Reviewed-on: https://chromium-review.googlesource.com/1128087
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573278}
@andypaicu andypaicu merged commit af505e8 into w3c:master Jul 10, 2018
@andypaicu andypaicu deleted the child-src-undep branch July 10, 2018 09:18
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 20, 2018
Automatic update from web-platform-testsUn-deprecated 'child-src'

'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
Reviewed-on: https://chromium-review.googlesource.com/1128087
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573278}

--

wpt-commits: dceb242f223cae966354d8d4558492b28f9238cf
wpt-pr: 11838
jankeromnes pushed a commit to jankeromnes/gecko that referenced this pull request Jul 23, 2018
Automatic update from web-platform-testsUn-deprecated 'child-src'

'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
Reviewed-on: https://chromium-review.googlesource.com/1128087
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573278}

--

wpt-commits: dceb242f223cae966354d8d4558492b28f9238cf
wpt-pr: 11838
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
Automatic update from web-platform-testsUn-deprecated 'child-src'

'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
Reviewed-on: https://chromium-review.googlesource.com/1128087
Commit-Queue: Andy Paicu <andypaicuchromium.org>
Reviewed-by: Mike West <mkwstchromium.org>
Cr-Commit-Position: refs/heads/master{#573278}

--

wpt-commits: dceb242f223cae966354d8d4558492b28f9238cf
wpt-pr: 11838

UltraBlame original commit: 80e0f50335811cd740bbfbeb3d6e765d650b4400
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
Automatic update from web-platform-testsUn-deprecated 'child-src'

'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
Reviewed-on: https://chromium-review.googlesource.com/1128087
Commit-Queue: Andy Paicu <andypaicuchromium.org>
Reviewed-by: Mike West <mkwstchromium.org>
Cr-Commit-Position: refs/heads/master{#573278}

--

wpt-commits: dceb242f223cae966354d8d4558492b28f9238cf
wpt-pr: 11838

UltraBlame original commit: 80e0f50335811cd740bbfbeb3d6e765d650b4400
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
Automatic update from web-platform-testsUn-deprecated 'child-src'

'child-src' is now part of the fallback chain for 'worker-src'.
This means that 'child-src' always takes precedence over 'script-src'
when checking worker requests.
Added extra tests to ensure that a worker request blocked by
'child-src' and allowed by 'script-src' is blocked.

Removed previous logic that considered 'script-src' to be the
fallback for 'worker-src' and amended tests. Removed "temporary"
logic put in place to not break sites using "child-src".

Refactored the OperativeDirective logic to ensure that the caller
does not need to be aware of precise fallback chain of the directive,
otherwise the way to get the 'worker-src' operative directive would be:

OperativeDirective(worker_src_.Get(),
      OperativeDirective(child_src_.Get(),
          OperativeDirective(script_src_.Get())));

To be submitted with the spec PR as it includes tests.
Spec: w3c/webappsec-csp#313

Bug: 669496
Change-Id: I7ca9552df1d0ce203a604b0e469a268f6b112e49
Reviewed-on: https://chromium-review.googlesource.com/1128087
Commit-Queue: Andy Paicu <andypaicuchromium.org>
Reviewed-by: Mike West <mkwstchromium.org>
Cr-Commit-Position: refs/heads/master{#573278}

--

wpt-commits: dceb242f223cae966354d8d4558492b28f9238cf
wpt-pr: 11838

UltraBlame original commit: 80e0f50335811cd740bbfbeb3d6e765d650b4400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants