Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Issue 2006653005: Fix bug where a second CSP without script-src would cause failure (Closed)

Created:
4 years, 7 months ago by jww
Modified:
4 years, 6 months ago
Reviewers:
Mike West, estark
CC:
chromium-reviews, blink-reviews, mkwst+watchlist-csp_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix bug where a second CSP without script-src would cause failure After an earlier change to make sure report-only mode did not erroneously cause a policy failure (see https://codereview.chromium.org/1980533002), the logic was changed so that checking the script/style nonce would fail if a policy has no nonce entry for a directive. Unfortunately, this had the side effect of disallowing scripts/styles if there are two policies, and one allows inline scripts via nonce, and the other simply did not mention scripts. This modifies the nonce logic so that the allow[Script|Style]Nonce no longer returns a simple bool and instead returns a disposition of Allow, Deny, or NoPolicy. In the last case, this will not cause a failure in and of itself, and will allow other policies to be processed before a decision is made. BUG=614416, 611652 TBR=mkwst@chromium.org Committed: https://crrev.com/d9341c818db0c3f07aba8ad98e51eeeb71271506 Cr-Commit-Position: refs/heads/master@{#396104}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address estark's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -11 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/multiple-policies-with-nonce.php View 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h View 1 2 chunks +8 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp View 1 1 chunk +10 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 2 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 15 (7 generated)
jww
estark@, can you take a look at this? Thanks!
4 years, 7 months ago (2016-05-25 00:26:58 UTC) #3
estark
lgtm https://codereview.chromium.org/2006653005/diff/1/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h File third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h (right): https://codereview.chromium.org/2006653005/diff/1/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h#newcode29 third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h:29: NoPolicy = 0, optional nit: it might make ...
4 years, 7 months ago (2016-05-25 22:20:31 UTC) #4
jww
https://codereview.chromium.org/2006653005/diff/1/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h File third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h (right): https://codereview.chromium.org/2006653005/diff/1/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h#newcode29 third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h:29: NoPolicy = 0, On 2016/05/25 22:20:31, estark wrote: > ...
4 years, 7 months ago (2016-05-25 22:47:37 UTC) #5
jww
Since this is actively breaking sites, I'm TBR'ing Mike and sending to the commit queue, ...
4 years, 7 months ago (2016-05-25 22:49:47 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2006653005/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2006653005/20001
4 years, 7 months ago (2016-05-25 22:50:53 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 7 months ago (2016-05-26 03:39:25 UTC) #12
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/d9341c818db0c3f07aba8ad98e51eeeb71271506 Cr-Commit-Position: refs/heads/master@{#396104}
4 years, 7 months ago (2016-05-26 03:41:13 UTC) #14
Mike West
4 years, 6 months ago (2016-05-31 11:06:48 UTC) #15
Message was sent while issue was closed.
On 2016/05/25 at 22:49:47, jww wrote:
> Since this is actively breaking sites, I'm TBR'ing Mike and sending to the
commit queue, but Mike, it would be great if you can take a look when you get
back to sanity check.

This patch LGTM as a stopgap, but I think we need to significantly refactor
nonce handling in order to correctly handle report-only. We're simply not able
to handle cases in which we violate report-only, but don't violate enforce mode.
Starting to sketch out what that might look like in
https://codereview.chromium.org/2020223002. I'll eventually break that up into
more than one CL.

Powered by Google App Engine
This is Rietveld 408576698