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

Issue 2790693002: Split CSP into pre- and post-upgrade checks (Closed)

Created:
3 years, 8 months ago by estark
Modified:
3 years, 8 months ago
Reviewers:
Mike West, elawrence
CC:
blink-reviews, blink-reviews-frames_chromium.org, blink-worker-reviews_chromium.org, chromium-reviews, falken+watch_chromium.org, gavinp+loader_chromium.org, haraken, horo+watch_chromium.org, Nate Chapin, jsbell+serviceworker_chromium.org, kinuko+worker_chromium.org, kinuko+watch, kinuko+serviceworker, loading-reviews+fetch_chromium.org, loading-reviews_chromium.org, michaeln, nhiroki, serviceworker-reviews, shimazu+worker_chromium.org, shimazu+serviceworker_chromium.org, tfarina, tyoshino+watch_chromium.org, tzik, Yoav Weiss
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Split CSP into pre- and post-upgrade checks When populating a resource request, before upgrading an insecure request if appropriate, we now check report-only CSP headers, to ensure that CSP report-only violations are reported before any modifications of the request. After modifying the request, we check the enforced CSP headers to ensure that the request is still allowed. This is as described in the upgrade-insecure-requests spec: https://w3c.github.io/webappsec-upgrade-insecure-requests/#reporting-upgrades Patch stolen from mkwst@ BUG=625156 TEST=added web platform test upgrade-insecure-requests-reporting.https.html Review-Url: https://codereview.chromium.org/2790693002 Cr-Commit-Position: refs/heads/master@{#465741} Committed: https://chromium.googlesource.com/chromium/src/+/a98bc6ea35dbcc498eaa7a84b67e91622d8eb4d0

Patch Set 1 #

Patch Set 2 : Remove unnecessary FetchContext method #

Patch Set 3 : rebase #

Patch Set 4 : rebase #

Patch Set 5 : update tests, fix redirects #

Patch Set 6 : rebase #

Patch Set 7 : rebase fixups #

Patch Set 8 : use modified url for canRequest #

Patch Set 9 : rebase, yay blink reformat #

Patch Set 10 : fix unit tests #

Patch Set 11 : add wpt test #

Patch Set 12 : add unit tests #

Total comments: 11

Patch Set 13 : mkwst comments, fix some stuff #

Patch Set 14 : fix indentation #

Total comments: 1

Patch Set 15 : rebase #

Patch Set 16 : revert accidental AbstractWorker change #

Total comments: 3

Patch Set 17 : rebase #

Patch Set 18 : add mkwst TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+675 lines, -197 lines) Patch
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/frame-src/frame-src-redirect.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +35 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/frame-src/frame-src-redirect.html.headers View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/frame-src/support/frame.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/frame-src/support/testharness-helper.sub.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/img-src-redirect-upgrade-reporting.https.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/img-src-redirect-upgrade-reporting.https.html.headers View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/support/testharness-helper.sub.js View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/upgrade-insecure-requests-reporting.https.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +60 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/upgrade-insecure-requests-reporting.https.html.headers View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/multiple-report-policies-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/import-multiple-blocked.php View 1 chunk +2 lines, -8 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/import-reportonly-allowed.php View 1 chunk +1 line, -7 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin-expected.txt View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri-expected.txt View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-01-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-original-url.php View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -9 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-multiple-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-multiple-reversed-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 chunks +62 lines, -34 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 10 chunks +104 lines, -44 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +42 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +21 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +66 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +63 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +102 lines, -45 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/FetchContext.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +14 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/FetchContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/loader/testing/MockFetchContext.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 77 (65 generated)
estark
mkwst, PTAL at this patch that is mostly stolen from you? :) This is so ...
3 years, 8 months ago (2017-04-12 01:35:19 UTC) #39
Mike West
The code and overall approach looks good, but I'd like to see a few more ...
3 years, 8 months ago (2017-04-12 13:31:36 UTC) #42
estark
Thanks Mike! Your comments triggered me to discover an exciting series of riddles wrapped in ...
3 years, 8 months ago (2017-04-13 01:42:18 UTC) #45
estark
https://codereview.chromium.org/2790693002/diff/260001/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/frame-src/frame-src-redirect.html File third_party/WebKit/LayoutTests/external/wpt/content-security-policy/frame-src/frame-src-redirect.html (right): https://codereview.chromium.org/2790693002/diff/260001/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/frame-src/frame-src-redirect.html#newcode10 third_party/WebKit/LayoutTests/external/wpt/content-security-policy/frame-src/frame-src-redirect.html:10: if (e.originalPolicy == policy && (new URL(e.blockedURI)).origin == blocked_origin) ...
3 years, 8 months ago (2017-04-13 02:31:53 UTC) #49
Mike West
I'm OOO through Tuesday; I skimmed this, and it looks reasonable, but I'm supposed to ...
3 years, 8 months ago (2017-04-14 16:12:12 UTC) #58
elawrence
On 2017/04/14 16:12:12, Mike West (OOO until 18th) wrote: > I'm OOO through Tuesday; I ...
3 years, 8 months ago (2017-04-14 16:39:44 UTC) #59
Mike West
LGTM. Thank you for digging into this, Emily. The plznavigate bit is a mess, indeed. ...
3 years, 8 months ago (2017-04-19 08:42:13 UTC) #64
estark
Thanks, Mike! https://codereview.chromium.org/2790693002/diff/300001/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp File third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp (right): https://codereview.chromium.org/2790693002/diff/300001/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp#newcode963 third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp:963: // impact of this backwards-incompatible change. On ...
3 years, 8 months ago (2017-04-19 16:23:54 UTC) #69
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2790693002/340001
3 years, 8 months ago (2017-04-19 16:24:21 UTC) #70
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/434420)
3 years, 8 months ago (2017-04-19 18:40:31 UTC) #72
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2790693002/340001
3 years, 8 months ago (2017-04-19 20:00:48 UTC) #74
commit-bot: I haz the power
3 years, 8 months ago (2017-04-19 20:53:16 UTC) #77
Message was sent while issue was closed.
Committed patchset #18 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/a98bc6ea35dbcc498eaa7a84b67e...

Powered by Google App Engine
This is Rietveld 408576698