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

Issue 1980533002: CSP: Fix handling of nonces in report-only mode. (Closed)

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

Description

CSP: Fix handling of nonces in report-only mode. Our current implementation will only allow a nonce to bypass whitelists if it is present in all active policies, not just those delivered in enforce-mode. This patch adjusts the logic in ContentSecurityPolicy to ensure that nonces bypass whitelists if and only if they are present in each enforced policy. In particular, note that policies which do not contain the relevant directive will no longer be considered as passing a nonce check (though they will, of course, continue to pass the whitelist check which happens during fetching). BUG=611652 Committed: https://crrev.com/a309dc2c752b103e6e858a92a0b68ab824212cb0 Cr-Commit-Position: refs/heads/master@{#395189}

Patch Set 1 #

Total comments: 2

Patch Set 2 : estark@ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -5 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/multiple-policies-with-nonce.php View 1 chunk +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 1 1 chunk +14 lines, -4 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
Mike West
Emily, mind taking a look at this? aaj@: FYI.
4 years, 7 months ago (2016-05-13 15:02:23 UTC) #3
estark
https://codereview.chromium.org/1980533002/diff/1/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp File third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp (right): https://codereview.chromium.org/1980533002/diff/1/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp#newcode364 third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp:364: int isExplicitlyAllowed = false; why an int instead of ...
4 years, 7 months ago (2016-05-13 15:25:50 UTC) #4
Mike West
On 2016/05/13 at 15:25:50, estark wrote: > https://codereview.chromium.org/1980533002/diff/1/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp > File third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp (right): > > https://codereview.chromium.org/1980533002/diff/1/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp#newcode364 ...
4 years, 7 months ago (2016-05-15 14:10:08 UTC) #5
estark
Ah, ok, thanks for the explanation. LGTM with two caveats: 1. Looks like you might ...
4 years, 7 months ago (2016-05-17 05:57:07 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1980533002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1980533002/20001
4 years, 7 months ago (2016-05-20 20:36:31 UTC) #9
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 7 months ago (2016-05-20 22:30:22 UTC) #10
commit-bot: I haz the power
4 years, 7 months ago (2016-05-20 22:31:58 UTC) #12
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/a309dc2c752b103e6e858a92a0b68ab824212cb0
Cr-Commit-Position: refs/heads/master@{#395189}

Powered by Google App Engine
This is Rietveld 408576698