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

Issue 1835463002: Stop supporting invalid CSP directives in meta tags (Closed)

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

Description

Stop supporting invalid CSP directives in meta tags https://www.w3.org/TR/CSP2/#delivery-html-meta-element says that frame-ancestors, sandbox, and report-uri should be discarded when parsing Content Security Policies delivered in meta elements. This CL changes CSPDirectiveList to discard such directives, log to the console upon encountering them, and increment a UseCounter so we can see if this breaks the web badly. A bunch of layout tests used meta elements to set report-uris, so this CL also updates these tests to deliver their CSPs in headers instead. BUG=594645 Committed: https://crrev.com/f5c8a2b4ed6b3a3cb3bd148f5ede561419b1e40a Cr-Commit-Position: refs/heads/master@{#385199}

Patch Set 1 #

Patch Set 2 : undo debugging change #

Patch Set 3 : minor cleanup #

Patch Set 4 : fix weird linker error, maybe? please? #

Patch Set 5 : fix some (not all) tests #

Patch Set 6 : rebase #

Patch Set 7 : fix build after rebase #

Patch Set 8 : add CORE_EXPORT #

Patch Set 9 : remove service worker extendable event test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+280 lines, -639 lines) Patch
D third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-at-unique-origin-denied.html View 1 2 3 4 1 chunk +0 lines, -18 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-at-unique-origin-denied.php View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-unique-origin-denied.html View 1 2 3 4 1 chunk +0 lines, -23 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-unique-origin-denied.php View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive.html View 1 chunk +0 lines, -13 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode.html View 1 2 3 4 1 chunk +0 lines, -21 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode.php View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report.html View 1 chunk +0 lines, -20 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report.php View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-and-sends-report-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-allowed-in-report-only-mode-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-blocked-and-sends-report.html View 1 chunk +0 lines, -17 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-blocked-and-sends-report.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-blocked-and-sends-report-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/invalid-meta-directives.html View 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/invalid-meta-directives-expected.txt View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-and-enforce.html View 1 chunk +0 lines, -17 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-and-enforce.php View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt View 1 chunk +5 lines, -5 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-data-uri.html View 1 chunk +0 lines, -11 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-data-uri.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-data-uri-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-file-uri.html View 1 chunk +0 lines, -18 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-file-uri.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-file-uri-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri.html View 1 chunk +0 lines, -5 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri.php View 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin.html View 1 chunk +0 lines, -5 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.html View 1 chunk +0 lines, -20 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-01.html View 1 chunk +0 lines, -13 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-01.php View 1 chunk +3 lines, -1 line 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
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-02.html View 1 chunk +0 lines, -16 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-multiple-violations-02.php View 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-only.html View 1 chunk +0 lines, -7 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-only.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-only-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-only-report-uri-missing.html View 1 2 3 4 1 chunk +0 lines, -10 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-only-report-uri-missing.php View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-only-report-uri-missing-expected.txt View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies.html View 1 chunk +0 lines, -20 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri.html View 1 chunk +0 lines, -7 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-child-frame.html View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt View 2 chunks +4 lines, -4 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript.html View 1 chunk +0 lines, -16 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-javascript.html View 1 chunk +0 lines, -11 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-javascript.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-javascript-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-scheme-relative.html View 1 chunk +0 lines, -7 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-scheme-relative.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-scheme-relative-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/generate-csp-report.html View 1 chunk +0 lines, -6 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/generate-csp-report.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/sandbox.php View 1 chunk +10 lines, -0 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-allow-scripts.html View 1 chunk +0 lines, -9 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-allow-scripts.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-subframe.html View 1 chunk +0 lines, -7 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-subframe.php View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-empty.html View 1 chunk +7 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-empty-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-empty-subframe.html View 1 chunk +7 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-empty-subframe-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/xmlhttprequest-protected-resource-does-not-crash.html View 1 chunk +1 line, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/sandbox-iframe-allows-modals.html View 1 2 3 4 1 chunk +0 lines, -31 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/sandbox-iframe-allows-modals.php View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/sandbox-iframe-blocks-modals.html View 1 2 3 4 1 chunk +0 lines, -31 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/sandbox-iframe-blocks-modals.php View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/sandbox-inherit-to-blank-document.html View 1 2 3 4 1 chunk +0 lines, -30 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/sandbox-inherit-to-blank-document.php View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/sandbox-inherit-to-blank-document-unsandboxed.html View 1 2 3 4 1 chunk +0 lines, -30 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/sandbox-inherit-to-blank-document-unsandboxed.php View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/sandbox-inherit-to-blank-document-unsandboxed-navigate.html View 1 2 3 4 1 chunk +0 lines, -38 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/security/sandbox-inherit-to-blank-document-unsandboxed-navigate.php View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/extendable-message-event.html View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -37 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/extendable-message-event-sandboxed-iframe.html View 1 2 3 4 1 chunk +0 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/core/frame/UseCounter.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp View 1 2 3 4 5 4 chunks +23 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp View 1 2 3 4 5 6 2 chunks +38 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (6 generated)
estark
Hi Mike, welcome back! Could you take a look please? (Don't be frightened by the ...
4 years, 8 months ago (2016-03-31 00:38:20 UTC) #3
Mike West
On 2016/03/31 at 00:38:20, estark wrote: > Hi Mike, welcome back! Could you take a ...
4 years, 8 months ago (2016-04-01 13:37:38 UTC) #4
Mike West
So, in summary, `report-uri` and `frame-ancestors` LGTM. I'm not convinced about `sandbox`, but let's chat. ...
4 years, 8 months ago (2016-04-01 13:38:55 UTC) #5
estark
On 2016/04/01 13:37:38, Mike West (OOO through 31st) wrote: > On 2016/03/31 at 00:38:20, estark ...
4 years, 8 months ago (2016-04-01 17:51:53 UTC) #6
Mike West
On 2016/04/01 at 17:51:53, estark wrote: > On 2016/04/01 13:37:38, Mike West (OOO through 31st) ...
4 years, 8 months ago (2016-04-02 05:18:54 UTC) #7
estark
Mike: if and when you feel convinced about dropping sandbox support, this is ready for ...
4 years, 8 months ago (2016-04-05 06:10:28 UTC) #8
Mike West
On 2016/04/05 at 06:10:28, estark wrote: > Mike: if and when you feel convinced about ...
4 years, 8 months ago (2016-04-05 08:10:51 UTC) #9
estark
mpearson, can you please review histograms.xml?
4 years, 8 months ago (2016-04-05 15:32:04 UTC) #11
Mark P
histograms.xml lgtm
4 years, 8 months ago (2016-04-05 16:56:32 UTC) #12
estark
On 2016/04/05 08:10:51, Mike West (OOO through 31st) wrote: > On 2016/04/05 at 06:10:28, estark ...
4 years, 8 months ago (2016-04-05 16:57:45 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1835463002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1835463002/160001
4 years, 8 months ago (2016-04-05 16:58:31 UTC) #15
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 8 months ago (2016-04-05 17:06:09 UTC) #17
commit-bot: I haz the power
4 years, 8 months ago (2016-04-05 17:07:59 UTC) #19
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/f5c8a2b4ed6b3a3cb3bd148f5ede561419b1e40a
Cr-Commit-Position: refs/heads/master@{#385199}

Powered by Google App Engine
This is Rietveld 408576698