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

Issue 747403002: Ignore insecure parts of CSP in extensions and allow extension to load (Closed)

Created:
6 years, 1 month ago by robwu
Modified:
5 years, 11 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Ignore insecure parts of CSP in extensions and allow extension to load Previously, insecure CSP directive values caused refusal of Chrome to load the Chrome extension. Now, insecure values are stripped from the CSP, and a list of detailed warnings is printed at the extensions page. Renamed ContentSecurityPolicyIsSecure to SanitizeContentSecurityPolicy and let it return a string (the sanitized CSP) instead of a boolean that tells whether the CSP was considered secure. BUG=434773 R=kalman@chromium.org R=mkwst@chromium.org TEST=extensions_unittests=ExtensionCSPValidator.* unit_tests=ContentSecurityPolicyManifestTest.*:PlatformAppsManifestTest:PlatformAppContentSecurityPolicy Committed: https://crrev.com/f19335614f1a7f78b76a640aba422b13e51a2391 Cr-Commit-Position: refs/heads/master@{#310191}

Patch Set 1 #

Total comments: 10

Patch Set 2 : comments #7 #

Total comments: 1

Patch Set 3 : rebase #

Total comments: 20

Patch Set 4 : small nits #

Total comments: 5

Patch Set 5 : ContentSecurityPolicyIsSecure -> SanitizeContentSecurityPolicy + tests & nits #

Patch Set 6 : rebase #

Patch Set 7 : Normalize app's default CSP to match format of SanitizeContentSecurityPolicy (spaces) #

Patch Set 8 : Fix test expectations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+514 lines, -289 lines) Patch
M chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc View 1 chunk +13 lines, -8 lines 0 comments Download
M chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/common/extensions/manifest_tests/extension_manifests_sandboxed_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M extensions/common/csp_validator.h View 1 2 3 4 5 1 chunk +7 lines, -2 lines 0 comments Download
M extensions/common/csp_validator.cc View 1 2 3 4 5 10 chunks +104 lines, -80 lines 0 comments Download
M extensions/common/csp_validator_unittest.cc View 1 2 3 4 5 2 chunks +355 lines, -170 lines 0 comments Download
M extensions/common/manifest_constants.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/common/manifest_constants.cc View 1 2 3 4 5 2 chunks +7 lines, -10 lines 0 comments Download
M extensions/common/manifest_handlers/csp_info.cc View 1 2 3 4 5 6 5 chunks +21 lines, -15 lines 0 comments Download

Messages

Total messages: 27 (3 generated)
robwu
6 years, 1 month ago (2014-11-23 11:02:26 UTC) #1
Mike West
I haven't looked at the patch yet, but it's not clear to me that this ...
6 years, 1 month ago (2014-11-23 14:23:41 UTC) #2
robwu
On 2014/11/23 14:23:41, Mike West wrote: > I haven't looked at the patch yet, but ...
6 years, 1 month ago (2014-11-23 14:33:54 UTC) #3
Mike West
On 2014/11/23 14:33:54, robwu wrote: > On 2014/11/23 14:23:41, Mike West wrote: > > I ...
6 years ago (2014-11-23 16:26:19 UTC) #4
robwu
On 2014/11/23 16:26:19, Mike West wrote: > On 2014/11/23 14:33:54, robwu wrote: > > On ...
6 years ago (2014-11-23 16:34:59 UTC) #5
Mike West
A few comments off the top. Marking kalman@ as required; he knows the extension code ...
6 years ago (2014-11-24 11:37:19 UTC) #7
robwu
https://codereview.chromium.org/747403002/diff/1/extensions/common/csp_validator.cc File extensions/common/csp_validator.cc (right): https://codereview.chromium.org/747403002/diff/1/extensions/common/csp_validator.cc#newcode151 extensions/common/csp_validator.cc:151: csp_parts.back() += ";"; On 2014/11/24 11:37:19, Mike West wrote: ...
6 years ago (2014-11-24 12:19:47 UTC) #8
not at google - send to devlin
I'll stop reviewing there. Be aware of this CL: https://codereview.chromium.org/754713002/ you're going to stomp all ...
6 years ago (2014-11-24 18:26:08 UTC) #10
robwu
On 2014/11/24 18:26:08, kalman wrote: > I'll stop reviewing there. Be aware of this CL: ...
6 years ago (2014-11-24 18:33:11 UTC) #11
robwu
kalman@ I've rebased this CL onto the other CL, could you resume the review?
6 years ago (2014-11-26 09:14:01 UTC) #12
not at google - send to devlin
https://codereview.chromium.org/747403002/diff/40001/extensions/common/csp_validator.cc File extensions/common/csp_validator.cc (right): https://codereview.chromium.org/747403002/diff/40001/extensions/common/csp_validator.cc#newcode110 extensions/common/csp_validator.cc:110: csp_parts.push_back(directive_name); Only pass const references. If you need to ...
6 years ago (2014-12-01 19:19:31 UTC) #13
robwu
I've fixed the small stylistic issues that you mentioned, in the next patch set I'm ...
6 years ago (2014-12-02 23:42:09 UTC) #14
not at google - send to devlin
This ... mostly looks fine I guess? However I'm not comfortable for this to be ...
6 years ago (2014-12-03 20:33:05 UTC) #15
robwu
Mike: PTAL I have renamed ContentSecurityPolicyIsSecure to SanitizeContentSecurityPolicy. The method now returns a string instead ...
6 years ago (2014-12-09 18:38:51 UTC) #16
Mike West
The new implementation LGTM (sorry for the delay, I was out sick most of last ...
6 years ago (2014-12-15 08:43:22 UTC) #17
not at google - send to devlin
lgtm, thanks Mike and Rob.
6 years ago (2014-12-15 22:55:56 UTC) #18
robwu
raymes, I have rebased because of your CL at https://codereview.chromium.org/760513003. Could you double-check whether my ...
5 years, 12 months ago (2014-12-25 23:28:52 UTC) #19
raymes
lgtm Thanks! I don't see any problems with this. Note that now we're parsing the ...
5 years, 11 months ago (2015-01-05 01:50:51 UTC) #20
raymes
lgtm
5 years, 11 months ago (2015-01-05 01:51:14 UTC) #21
robwu
On 2015/01/05 01:50:51, raymes wrote: > lgtm > > Thanks! I don't see any problems ...
5 years, 11 months ago (2015-01-06 00:48:49 UTC) #22
not at google - send to devlin
lgtm
5 years, 11 months ago (2015-01-06 21:59:52 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/747403002/140001
5 years, 11 months ago (2015-01-06 22:05:29 UTC) #25
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 11 months ago (2015-01-07 00:39:03 UTC) #26
commit-bot: I haz the power
5 years, 11 months ago (2015-01-07 00:40:03 UTC) #27
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/f19335614f1a7f78b76a640aba422b13e51a2391
Cr-Commit-Position: refs/heads/master@{#310191}

Powered by Google App Engine
This is Rietveld 408576698