-
Notifications
You must be signed in to change notification settings - Fork 78
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
Conversation
There was a problem hiding this 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`). |
There was a problem hiding this comment.
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. :)
There was a problem hiding this comment.
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`" |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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?
There was a problem hiding this 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. :)
'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
'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
'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
'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}
'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}
'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}
7b84ec4
to
af9db19
Compare
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
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
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
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
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
#239
#299
Preview | Diff