Changeset 259829 in webkit
- Timestamp:
- Apr 9, 2020, 2:31:03 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 40 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked.html (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked.html (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-blocked.html (modified) (2 diffs)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-invalidnonce-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-invalidnonce.html (modified) (2 diffs)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked.html (modified) (2 diffs)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicyResponseHeaders.cpp (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicyResponseHeaders.h (modified) (1 diff)
-
Source/WebCore/platform/network/HTTPHeaderNames.in (modified) (1 diff)
-
Source/WebCore/platform/network/ResourceResponseBase.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259810 r259829 1 2020-04-09 Keith Miller <keith_miller@apple.com> 2 3 Remove legacy X-WebKit-CSP header support 4 https://bugs.webkit.org/show_bug.cgi?id=210256 5 6 Reviewed by Geoffrey Garen. 7 8 Fix tests so they ensure we don't respect legacy CSP headers anymore. 9 10 * http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked-expected.txt: 11 * http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html: 12 * http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked-expected.txt: 13 * http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked.html: 14 * http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked-expected.txt: 15 * http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked.html: 16 * http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked-expected.txt: 17 * http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html: 18 * http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-blocked-expected.txt: 19 * http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-blocked.html: 20 * http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-invalidnonce-expected.txt: 21 * http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-invalidnonce.html: 22 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt: 23 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.php: 24 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt: 25 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php: 26 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2-expected.txt: 27 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php: 28 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: 29 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php: 30 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: 31 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php: 32 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt: 33 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php: 34 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2-expected.txt: 35 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php: 36 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: 37 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php: 38 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: 39 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php: 40 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-expected.txt: 41 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked.html: 42 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce-expected.txt: 43 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce.html: 44 1 45 2020-04-09 Devin Rousso <drousso@apple.com> 2 46 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked-expected.txt
r198591 r259829 1 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/navigation/resources/form-target.pl because it does not appear in the form-action directive of the Content Security Policy. 2 3 Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed. 1 This page was requested with the HTTP method POST. 2 3 Parameters: 4 5 fieldname = fieldvalue 4 6 5 7 ============== Back Forward List ============== 6 curr-> http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/form-action-src-blocked.html **nav target** 8 http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/form-action-src-blocked.html **nav target** 9 curr-> http://127.0.0.1:8000/navigation/resources/form-target.pl **nav target** 7 10 =============================================== -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html
r125772 r259829 26 26 </form> 27 27 28 <p>Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed.</p> 28 <p> 29 Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed. 30 31 Update: Since we no longer support X-WebKit-CSP all the form should be submitted. 32 </p> 29 33 </body> 30 34 </html> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked-expected.txt
r198591 r259829 1 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/navigation/resources/form-target.pl?fieldname=fieldvalue because it does not appear in the form-action directive of the Content Security Policy. 2 3 Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed. 1 This page was requested with the HTTP method GET. 2 3 Parameters: 4 5 fieldname = fieldvalue 4 6 5 7 ============== Back Forward List ============== 6 curr-> http://127.0.0.1:8000/ security/contentSecurityPolicy/1.1/form-action-src-get-blocked.html**nav target**8 curr-> http://127.0.0.1:8000/navigation/resources/form-target.pl?fieldname=fieldvalue **nav target** 7 9 =============================================== -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked.html
r125772 r259829 24 24 </form> 25 25 26 <p>Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed.</p> 26 <p> 27 Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed. 28 29 Update: Since we no longer support X-WebKit-CSP the form should be submitted. 30 </p> 27 31 </body> 28 32 </html> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked-expected.txt
r198591 r259829 1 CONSOLE MESSAGE: Refused to load javascript:alert("FAIL!") because it does not appear in the form-action directive of the Content Security Policy. 1 ALERT: RAN CODE CORRECTLY! 2 2 3 Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a JavaScript alert. 3 Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a JavaScript alert. Update: Since we no longer support X-WebKit-CSP the form should be submitted. 4 4 5 5 ============== Back Forward List ============== -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-javascript-blocked.html
r125772 r259829 21 21 </head> 22 22 <body> 23 <form action='javascript:alert(" FAIL!")' id='theform' method='post'>23 <form action='javascript:alert("RAN CODE CORRECTLY!")' id='theform' method='post'> 24 24 <input type='text' name='fieldname' value='fieldvalue'> 25 25 <input type='submit' id='submit' value='submit'> 26 26 </form> 27 27 28 <p>Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a JavaScript alert.</p> 28 <p> 29 Tests that blocking form actions works correctly. If this test passes, you will see a console error, and will not see a JavaScript alert. 30 31 Update: Since we no longer support X-WebKit-CSP the form should be submitted. 32 </p> 29 33 </body> 30 34 </html> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked-expected.txt
r198591 r259829 1 CONSOLE MESSAGE: Refused to load http://localhost:8000/navigation/resources/form-target.pl because it does not appear in the form-action directive of the Content Security Policy. 2 3 Tests that blocking form redirect works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed. 1 This page was requested with the HTTP method GET. 4 2 5 ============== Back Forward List ============== 6 curr-> http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html **nav target** 7 =============================================== 3 Parameters: 4 5 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-redirect-blocked.html
r125772 r259829 26 26 </form> 27 27 28 <p>Tests that blocking form redirect works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed.</p> 28 <p> 29 Tests that blocking form redirect works correctly. If this test passes, you will see a console error, and will not see a page indicating a form was POSTed. 30 31 Update: Since we no longer support X-WebKit-CSP the form should be submitted. 32 </p> 29 33 </body> 30 34 </html> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-blocked-expected.txt
r231450 r259829 1 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 2 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 3 Only the first two of these scripts should execute even though there are parse errors in the policy. 1 Only the first two of these scripts should execute even though there are parse errors in the policy. Update: Since we no longer support X-WebKit-CSP all the scripts should run. 4 2 5 3 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-blocked.html
r208788 r259829 8 8 ['yes', 'script-src 127.0.0.1:8000 \'nonce-nonce\'', 'resources/script.js', 'nonce'], 9 9 ['yes', 'script-src 127.0.0.1:8000 \'nonce-base64has+and/characters\'', 'resources/script.js', 'base64has+and/characters'], 10 [' no', 'script-src \'nonce-nonce\'', 'resources/script.js', 'notnonce'],11 [' no', 'script-src \'nonce-notnonce\'', 'resources/script.js', 'nonce'],10 ['yes', 'script-src \'nonce-nonce\'', 'resources/script.js', 'notnonce'], 11 ['yes', 'script-src \'nonce-notnonce\'', 'resources/script.js', 'nonce'], 12 12 ]; 13 13 </script> … … 16 16 <p> 17 17 Only the first two of these scripts should execute even though there are parse errors in the policy. 18 19 Update: Since we no longer support X-WebKit-CSP all the scripts should run. 18 20 </p> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-invalidnonce-expected.txt
r231450 r259829 1 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''n'. It will be ignored. 2 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 3 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce'. It will be ignored. 4 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 5 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-''. It will be ignored. 6 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 7 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-'. It will be ignored. 8 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 9 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 10 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-'. It will be ignored. 11 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: '''. It will be ignored. 12 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 13 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-'. It will be ignored. 14 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: '''. It will be ignored. 15 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 16 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-'. It will be ignored. 17 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: 'spaces''. It will be ignored. 18 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 19 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-{}''. It will be ignored. 20 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 21 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-/\''. It will be ignored. 22 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 23 None of these scripts should execute, as all the nonces are invalid. 1 None of these scripts should execute, as all the nonces are invalid. Update: Since we no longer support X-WebKit-CSP all the scripts should run. 24 2 25 3 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-invalidnonce.html
r208788 r259829 5 5 <script> 6 6 var tests = [ 7 [' no', 'script-src \'n', 'resources/script.js', ''],8 [' no', 'script-src \'nonce', 'resources/script.js', ''],9 [' no', 'script-src \'nonce-\'', 'resources/script.js', ''],10 [' no', 'script-src \'nonce-', 'resources/script.js', ''],11 [' no', 'script-src nonce-abcd', 'resources/script.js', ''],12 [' no', 'script-src \'nonce- \'', 'resources/script.js', ''],13 [' no', 'script-src \'nonce- \'', 'resources/script.js', ''],14 [' no', 'script-src \'nonce- nonces have no spaces\'', 'resources/script.js', ''],15 [' no', 'script-src \'nonce-{}\'', 'resources/script.js', '{}'],16 [' no', 'script-src \'nonce-/\\\'', 'resources/script.js', '/\\'],7 ['yes', 'script-src \'n', 'resources/script.js', ''], 8 ['yes', 'script-src \'nonce', 'resources/script.js', ''], 9 ['yes', 'script-src \'nonce-\'', 'resources/script.js', ''], 10 ['yes', 'script-src \'nonce-', 'resources/script.js', ''], 11 ['yes', 'script-src nonce-abcd', 'resources/script.js', ''], 12 ['yes', 'script-src \'nonce- \'', 'resources/script.js', ''], 13 ['yes', 'script-src \'nonce- \'', 'resources/script.js', ''], 14 ['yes', 'script-src \'nonce- nonces have no spaces\'', 'resources/script.js', ''], 15 ['yes', 'script-src \'nonce-{}\'', 'resources/script.js', '{}'], 16 ['yes', 'script-src \'nonce-/\\\'', 'resources/script.js', '/\\'], 17 17 ]; 18 18 </script> … … 21 21 <p> 22 22 None of these scripts should execute, as all the nonces are invalid. 23 24 Update: Since we no longer support X-WebKit-CSP all the scripts should run. 23 25 </p> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt
r231450 r259829 1 1 CONSOLE MESSAGE: The Content Security Policy 'script-src 'sha256-AJqUvsXuHfMNXALcBPVqeiKkFk8OLvn3U7ksHP/QQ90=' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 2 CONSOLE MESSAGE: line 13: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 CONSOLE MESSAGE: The Content Security Policy 'script-src 'sha256-AJqUvsXuHfMNXALcBPVqeiKkFk8OLvn3U7ksHP/QQ90=' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 4 PASS did not execute script. 5 6 7 8 -------- 9 Frame: '<!--frame1-->' 10 -------- 11 CSP report received: 12 CONTENT_TYPE: application/csp-report 13 HTTP_HOST: 127.0.0.1:8000 14 HTTP_REFERER: http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php 15 REQUEST_METHOD: POST 16 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.php?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php 17 === POST DATA === 18 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php","referrer":"","violated-directive":"script-src 'nonce-dump-as-text'","effective-directive":"script-src","original-policy":"script-src 'nonce-dump-as-text'; report-uri ../resources/save-report.php?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php","blocked-uri":"","status-code":200}} 2 CONSOLE MESSAGE: line 11: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php
r203434 r259829 7 7 <head> 8 8 <script nonce="dump-as-text"> 9 if (window.testRunner) {9 if (window.testRunner) 10 10 testRunner.dumpAsText(); 11 testRunner.dumpChildFramesAsText();12 }13 11 </script> 14 12 </head> 15 13 <body> 16 <p id="result"> PASSdid not execute script.</p>14 <p id="result">FAIL did not execute script.</p> 17 15 <script> 18 document.getElementById("result").textContent = " FAILdid execute script.";16 document.getElementById("result").textContent = "PASS did execute script."; 19 17 </script> 18 <!-- Call testRunner.dumpChildFramesAsText() and load 20 19 <iframe src="../resources/echo-report.php?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php"></iframe> 20 once we fix reporting of nonce violations for report-only policies. See <https://bugs.webkit.org/show_bug.cgi?id=159830>. --> 21 21 </body> 22 22 </html> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2-expected.txt
r203434 r259829 1 1 CONSOLE MESSAGE: The Content Security Policy 'script-src 'sha256-AJqUvsXuHfMNXALcBPVqeiKkFk8OLvn3U7ksHP/QQ90=' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 2 CONSOLE MESSAGE: line 12: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.3 PASS did notexecute script.2 CONSOLE MESSAGE: line 12: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php
r203434 r259829 12 12 </head> 13 13 <body> 14 <p id="result"> PASSdid not execute script.</p>14 <p id="result">FAIL did not execute script.</p> 15 15 <script> 16 document.getElementById("result").textContent = " FAILdid execute script.";16 document.getElementById("result").textContent = "PASS did execute script."; 17 17 </script> 18 18 </body> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt
r231450 r259829 1 1 CONSOLE MESSAGE: line 13: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 2 CONSOLE MESSAGE: line 13: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 PASS did not execute script. 2 PASS did execute script. 4 3 5 4 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php
r203434 r259829 14 14 </head> 15 15 <body> 16 <p id="result"> PASSdid not execute script.</p>16 <p id="result">FAIL did not execute script.</p> 17 17 <script> 18 document.getElementById("result").textContent = " FAILdid execute script.";18 document.getElementById("result").textContent = "PASS did execute script."; 19 19 </script> 20 20 <iframe src="../resources/echo-report.php?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php"></iframe> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt
r231450 r259829 1 1 CONSOLE MESSAGE: line 14: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 2 CONSOLE MESSAGE: line 14: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 PASS did not execute script. 2 PASS did execute script. 4 3 5 4 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
r203434 r259829 14 14 </head> 15 15 <body> 16 <p id="result"> PASSdid not execute script.</p>16 <p id="result">FAIL did not execute script.</p> 17 17 <script> 18 document.getElementById("result").textContent = " FAILdid execute script.";18 document.getElementById("result").textContent = "PASS did execute script."; 19 19 </script> 20 20 <iframe src="../resources/echo-report.php?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php"></iframe> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt
r231450 r259829 1 1 CONSOLE MESSAGE: The Content Security Policy 'script-src 'nonce-dummy' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 2 CONSOLE MESSAGE: line 13: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 CONSOLE MESSAGE: line 13: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 4 CONSOLE MESSAGE: The Content Security Policy 'script-src 'nonce-dummy' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 5 PASS did not execute script. 6 7 8 9 -------- 10 Frame: '<!--frame1-->' 11 -------- 12 CSP report received: 13 CONTENT_TYPE: application/csp-report 14 HTTP_HOST: 127.0.0.1:8000 15 HTTP_REFERER: http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php 16 REQUEST_METHOD: POST 17 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php 18 === POST DATA === 19 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php","referrer":"","violated-directive":"script-src 'nonce-dump-as-text'","effective-directive":"script-src","original-policy":"script-src 'nonce-dump-as-text'; report-uri ../resources/save-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php","blocked-uri":"","status-code":200}} 2 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php
r203434 r259829 7 7 <head> 8 8 <script nonce="dump-as-text"> 9 if (window.testRunner) {9 if (window.testRunner) 10 10 testRunner.dumpAsText(); 11 testRunner.dumpChildFramesAsText();12 }13 11 </script> 14 12 </head> 15 13 <body> 16 <p id="result"> PASSdid not execute script.</p>14 <p id="result">FAIL did not execute script.</p> 17 15 <script nonce="dummy"> 18 document.getElementById("result").textContent = " FAILdid execute script.";16 document.getElementById("result").textContent = "PASS did execute script."; 19 17 </script> 18 <!-- Call testRunner.dumpChildFramesAsText() and load 20 19 <iframe src="../resources/echo-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php"></iframe> 20 once we fix reporting of nonce violations for report-only policies. See <https://bugs.webkit.org/show_bug.cgi?id=159830>. --> 21 21 </body> 22 22 </html> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2-expected.txt
r203434 r259829 1 1 CONSOLE MESSAGE: The Content Security Policy 'script-src 'nonce-dummy' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 2 CONSOLE MESSAGE: line 12: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 CONSOLE MESSAGE: line 12: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 4 PASS did not execute script. 2 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php
r203434 r259829 12 12 </head> 13 13 <body> 14 <p id="result"> PASSdid not execute script.</p>14 <p id="result">FAIL did not execute script.</p> 15 15 <script nonce="dummy"> 16 document.getElementById("result").textContent = " FAILdid execute script.";16 document.getElementById("result").textContent = "PASS did execute script."; 17 17 </script> 18 18 </body> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt
r231450 r259829 1 CONSOLE MESSAGE: line 13: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 2 CONSOLE MESSAGE: line 13: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 PASS did not execute script. 4 5 6 7 -------- 8 Frame: '<!--frame1-->' 9 -------- 10 CSP report received: 11 CONTENT_TYPE: application/csp-report 12 HTTP_HOST: 127.0.0.1:8000 13 HTTP_REFERER: http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php 14 REQUEST_METHOD: POST 15 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php 16 === POST DATA === 17 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php","referrer":"","violated-directive":"script-src 'nonce-that-is-not-equal-to-dummy' 'nonce-dump-as-text'","effective-directive":"script-src","original-policy":"script-src 'nonce-that-is-not-equal-to-dummy' 'nonce-dump-as-text'; report-uri ../resources/save-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php","blocked-uri":"","status-code":200}} 1 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php
r203434 r259829 7 7 <head> 8 8 <script nonce="dump-as-text"> 9 if (window.testRunner) {9 if (window.testRunner) 10 10 testRunner.dumpAsText(); 11 testRunner.dumpChildFramesAsText();12 }13 11 </script> 14 12 </head> 15 13 <body> 16 <p id="result"> PASSdid not execute script.</p>14 <p id="result">FAIL did not execute script.</p> 17 15 <script nonce="dummy"> 18 document.getElementById("result").textContent = " FAILdid execute script.";16 document.getElementById("result").textContent = "PASS did execute script."; 19 17 </script> 18 <!-- Call testRunner.dumpChildFramesAsText() and load 20 19 <iframe src="../resources/echo-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php"></iframe> 20 once we fix reporting of nonce violations for report-only policies. See <https://bugs.webkit.org/show_bug.cgi?id=159830>. --> 21 21 </body> 22 22 </html> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt
r231450 r259829 1 CONSOLE MESSAGE: line 14: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 2 CONSOLE MESSAGE: line 14: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 PASS did not execute script. 4 5 6 7 -------- 8 Frame: '<!--frame1-->' 9 -------- 10 CSP report received: 11 CONTENT_TYPE: application/csp-report 12 HTTP_HOST: 127.0.0.1:8000 13 HTTP_REFERER: http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php 14 REQUEST_METHOD: POST 15 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php 16 === POST DATA === 17 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php","referrer":"","violated-directive":"script-src 'nonce-that-is-not-equal-to-dummy' 'nonce-dump-as-text'","effective-directive":"script-src","original-policy":"script-src 'nonce-that-is-not-equal-to-dummy' 'nonce-dump-as-text'; report-uri ../resources/save-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php","blocked-uri":"","status-code":200}} 1 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
r203434 r259829 7 7 <meta http-equiv="X-WebKit-CSP" content="script-src 'nonce-dump-as-text'"> 8 8 <script nonce="dump-as-text"> 9 if (window.testRunner) {9 if (window.testRunner) 10 10 testRunner.dumpAsText(); 11 testRunner.dumpChildFramesAsText();12 }13 11 </script> 14 12 </head> 15 13 <body> 16 <p id="result"> PASSdid not execute script.</p>14 <p id="result">FAIL did not execute script.</p> 17 15 <script nonce="dummy"> 18 document.getElementById("result").textContent = " FAILdid execute script.";16 document.getElementById("result").textContent = "PASS did execute script."; 19 17 </script> 18 <!-- Call testRunner.dumpChildFramesAsText() and load 20 19 <iframe src="../resources/echo-report.php?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php"></iframe> 20 once we fix reporting of nonce violations for report-only policies. See <https://bugs.webkit.org/show_bug.cgi?id=159830>. --> 21 21 </body> 22 22 </html> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-expected.txt
r231450 r259829 1 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 2 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 3 Only the first two of these scripts should execute even though there are parse errors in the policy. 1 Only the first two of these scripts should execute even though there are parse errors in the policy. Update: Since we no longer support X-WebKit-CSP all the scripts should be executed. 4 2 5 3 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked.html
r195367 r259829 8 8 ['yes', 'script-src 127.0.0.1:8000 \'nonce-nonce\'', 'resources/script.js', 'nonce'], 9 9 ['yes', 'script-src 127.0.0.1:8000 \'nonce-base64has+and/characters\'', 'resources/script.js', 'base64has+and/characters'], 10 [' no', 'script-src \'nonce-nonce\'', 'resources/script.js', 'notnonce'],11 [' no', 'script-src \'nonce-notnonce\'', 'resources/script.js', 'nonce'],10 ['yes', 'script-src \'nonce-nonce\'', 'resources/script.js', 'notnonce'], 11 ['yes', 'script-src \'nonce-notnonce\'', 'resources/script.js', 'nonce'], 12 12 ]; 13 13 </script> … … 16 16 <p> 17 17 Only the first two of these scripts should execute even though there are parse errors in the policy. 18 19 Update: Since we no longer support X-WebKit-CSP all the scripts should be executed. 18 20 </p> -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce-expected.txt
r231450 r259829 1 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''n'. It will be ignored. 2 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 3 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce'. It will be ignored. 4 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 5 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-''. It will be ignored. 6 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 7 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-'. It will be ignored. 8 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 9 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 10 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-'. It will be ignored. 11 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: '''. It will be ignored. 12 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 13 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-'. It will be ignored. 14 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: '''. It will be ignored. 15 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 16 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-'. It will be ignored. 17 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: 'spaces''. It will be ignored. 18 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 19 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-{}''. It will be ignored. 20 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 21 CONSOLE MESSAGE: The source list for Content Security Policy directive 'script-src' contains an invalid source: ''nonce-/\''. It will be ignored. 22 CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js because it does not appear in the script-src directive of the Content Security Policy. 23 None of these scripts should execute, as all the nonces are invalid. 1 None of these scripts should execute, as all the nonces are invalid. Update: Since we no longer support X-WebKit-CSP all the scripts should be executed. 24 2 25 3 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce.html
r195367 r259829 5 5 <script> 6 6 var tests = [ 7 [' no', 'script-src \'n', 'resources/script.js', ''],8 [' no', 'script-src \'nonce', 'resources/script.js', ''],9 [' no', 'script-src \'nonce-\'', 'resources/script.js', ''],10 [' no', 'script-src \'nonce-', 'resources/script.js', ''],11 [' no', 'script-src nonce-abcd', 'resources/script.js', ''],12 [' no', 'script-src \'nonce- \'', 'resources/script.js', ''],13 [' no', 'script-src \'nonce- \'', 'resources/script.js', ''],14 [' no', 'script-src \'nonce- nonces have no spaces\'', 'resources/script.js', ''],15 [' no', 'script-src \'nonce-{}\'', 'resources/script.js', '{}'],16 [' no', 'script-src \'nonce-/\\\'', 'resources/script.js', '/\\'],7 ['yes', 'script-src \'n', 'resources/script.js', ''], 8 ['yes', 'script-src \'nonce', 'resources/script.js', ''], 9 ['yes', 'script-src \'nonce-\'', 'resources/script.js', ''], 10 ['yes', 'script-src \'nonce-', 'resources/script.js', ''], 11 ['yes', 'script-src nonce-abcd', 'resources/script.js', ''], 12 ['yes', 'script-src \'nonce- \'', 'resources/script.js', ''], 13 ['yes', 'script-src \'nonce- \'', 'resources/script.js', ''], 14 ['yes', 'script-src \'nonce- nonces have no spaces\'', 'resources/script.js', ''], 15 ['yes', 'script-src \'nonce-{}\'', 'resources/script.js', '{}'], 16 ['yes', 'script-src \'nonce-/\\\'', 'resources/script.js', '/\\'], 17 17 ]; 18 18 </script> … … 21 21 <p> 22 22 None of these scripts should execute, as all the nonces are invalid. 23 24 Update: Since we no longer support X-WebKit-CSP all the scripts should be executed. 23 25 </p> -
trunk/Source/WebCore/ChangeLog
r259827 r259829 1 2020-04-09 Keith Miller <keith_miller@apple.com> 2 3 Remove legacy X-WebKit-CSP header support 4 https://bugs.webkit.org/show_bug.cgi?id=210256 5 <rdar://problem/60634363> 6 7 Reviewed by Geoffrey Garen. 8 9 Supporting this header is causes compatibly issues for some sites 10 and they appear to be misconfigured. Additionally, no other 11 browser has supported these headers in many years. This patch 12 removes all support for the legacy X-WebKit-CSP header. 13 14 * dom/Document.cpp: 15 (WebCore::Document::processHttpEquiv): 16 * page/csp/ContentSecurityPolicyDirectiveList.cpp: 17 (WebCore::ContentSecurityPolicyDirectiveList::ContentSecurityPolicyDirectiveList): 18 * page/csp/ContentSecurityPolicyResponseHeaders.cpp: 19 (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders): 20 * page/csp/ContentSecurityPolicyResponseHeaders.h: 21 * platform/network/HTTPHeaderNames.in: 22 * platform/network/ResourceResponseBase.cpp: 23 (WebCore::isSafeCrossOriginResponseHeader): 24 1 25 2020-04-09 Per Arne Vollan <pvollan@apple.com> 2 26 -
trunk/Source/WebCore/dom/Document.cpp
r259761 r259829 3646 3646 break; 3647 3647 3648 case HTTPHeaderName::XWebKitCSP:3649 if (isInDocumentHead)3650 contentSecurityPolicy()->didReceiveHeader(content, ContentSecurityPolicyHeaderType::PrefixedEnforce, ContentSecurityPolicy::PolicyFrom::HTTPEquivMeta, referrer(), httpStatusCode);3651 break;3652 3653 3648 default: 3654 3649 break; -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp
r251887 r259829 118 118 : m_policy(policy) 119 119 , m_headerType(type) 120 { 121 m_reportOnly = (type == ContentSecurityPolicyHeaderType::Report || type == ContentSecurityPolicyHeaderType::PrefixedReport); 120 , m_reportOnly(type == ContentSecurityPolicyHeaderType::Report) 121 { 122 122 } 123 123 -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyResponseHeaders.cpp
r231464 r259829 42 42 m_headers.append({ policyValue, ContentSecurityPolicyHeaderType::Report }); 43 43 44 policyValue = response.httpHeaderField(HTTPHeaderName::XWebKitCSP);45 if (!policyValue.isEmpty())46 m_headers.append({ policyValue, ContentSecurityPolicyHeaderType::PrefixedEnforce });47 48 policyValue = response.httpHeaderField(HTTPHeaderName::XWebKitCSPReportOnly);49 if (!policyValue.isEmpty())50 m_headers.append({ policyValue, ContentSecurityPolicyHeaderType::PrefixedReport });51 52 44 m_httpStatusCode = response.httpStatusCode(); 53 45 } -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyResponseHeaders.h
r256482 r259829 37 37 Report, 38 38 Enforce, 39 PrefixedReport,40 PrefixedEnforce,41 39 }; 42 40 -
trunk/Source/WebCore/platform/network/HTTPHeaderNames.in
r253102 r259829 103 103 X-Frame-Options 104 104 X-SourceMap 105 X-WebKit-CSP106 X-WebKit-CSP-Report-Only107 105 X-XSS-Protection 108 106 X-Temp-Tablet -
trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp
r258631 r259829 436 436 || name == HTTPHeaderName::XDNSPrefetchControl 437 437 || name == HTTPHeaderName::XFrameOptions 438 || name == HTTPHeaderName::XWebKitCSP439 || name == HTTPHeaderName::XWebKitCSPReportOnly440 438 || name == HTTPHeaderName::XXSSProtection; 441 439 }
Note:
See TracChangeset
for help on using the changeset viewer.