Changeset 284254 in webkit
- Timestamp:
- Oct 15, 2021 10:39:39 AM (9 months ago)
- Location:
- trunk
- Files:
-
- 5 added
- 97 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports-expected.txt (modified) (3 diffs)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-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-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-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-child-src-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-child-src.html (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-default-src-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-default-src.html (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/report-only-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/report-only-upgrade-insecure-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-scheme-relative-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/blob/blob-urls-do-not-match-self.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/child-src/child-src-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/child-src/child-src-redirect-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/default-src-inline-blocked.sub-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/default-src/default-src-inline-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_1-img-src-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_1-script-src-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_10_1.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_2_2.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_2_3-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/meta/combine-header-and-meta-policies.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/navigation/javascript-url-navigation-inherits-csp-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/navigation/to-javascript-parent-initiated-parent-csp-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/reporting/report-uri-effective-directive-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-attr-allowed-src-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-attr-blocked-src-allowed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-allowed-attr-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-allowed-src-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-blocked-attr-allowed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-blocked-src-allowed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/strict-dynamic-elem-allowed-src-blocked-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/strict-dynamic-elem-blocked-src-allowed.sub-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/injected-inline-script-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-1_1-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-1_10-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-1_2-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-1_2_1-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-report-only-policy-works-with-external-hash-policy-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-report-only-policy-works-with-hash-policy-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/scriptnonce-and-scripthash.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/scriptnonce-basic-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/scriptnonce-ignore-unsafeinline.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/srcdoc-doesnt-bypass-script-src.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-attr-allowed-src-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-attr-blocked-src-allowed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-allowed-attr-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-allowed-src-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-blocked-attr-allowed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-blocked-src-allowed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/injected-inline-script-blocked.sub-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/injected-inline-style-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/inline-style-attribute-blocked-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/inline-style-attribute-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-hash-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-imported-style-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-injected-inline-style-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-attribute-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-nonce-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-none-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-stylesheet-nonce-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/stylehash-basic-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/stylenonce-allowed.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/stylenonce-blocked.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/svg/svg-inline.sub-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-href-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-href_blank-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-window_open-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-href-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-href_blank-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-window_open-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/script_event_handlers_denied_missing_unsafe_hashes-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/script_event_handlers_denied_wrong_hash-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/style_attribute_denied_missing_unsafe_hashes-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/style_attribute_denied_wrong_hash-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicy.cpp (modified) (7 diffs)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirective.cpp (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirective.h (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp (modified) (22 diffs)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h (modified) (3 diffs)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.cpp (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.h (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicySourceListDirective.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r284253 r284254 1 2021-10-15 Kate Cheney <katherine_cheney@apple.com> 2 3 CSP: Implement src-elem and src-attr directives 4 https://bugs.webkit.org/show_bug.cgi?id=231751 5 <rdar://problem/83332874> 6 7 Reviewed by Brent Fulgham. 8 9 * http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive-expected.txt: 10 * http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports-expected.txt: 11 * http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt: 12 * http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt: 13 * http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: 14 * http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: 15 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt: 16 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: 17 * http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: 18 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt: 19 * http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-child-src-expected.txt: 20 * http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-default-src-expected.txt: 21 These should both be reproting frame-src as the violated directive, 22 confirmed this behavior against Chrome. 23 24 * http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt: 25 * http/tests/security/contentSecurityPolicy/report-only-expected.txt: 26 * http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt: 27 * http/tests/security/contentSecurityPolicy/report-only-upgrade-insecure-expected.txt: 28 * http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https-expected.txt: 29 * http/tests/security/contentSecurityPolicy/report-uri-expected.txt: 30 * http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt: 31 * http/tests/security/contentSecurityPolicy/report-uri-scheme-relative-expected.txt: 32 1 33 2021-10-15 Ayumi Kojima <ayumi_kojima@apple.com> 2 34 -
trunk/LayoutTests/TestExpectations
r284235 r284254 908 908 909 909 # Skip Content Security Policy tests that time out 910 imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/ [ Skip ]911 imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/ [ Skip ]912 910 imported/w3c/web-platform-tests/content-security-policy/navigate-to/href-location-cross-origin-allowed.sub.html [ Skip ] 913 911 imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event.html [ Skip ] -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive-expected.txt
r284067 r284254 7 7 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py 8 8 === POST DATA === 9 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/report-uri-effective-directive.py","referrer":"","violated-directive":" default-src","effective-directive":"script-src","original-policy":"default-src 'self'; report-uri ../resources/save-report.py","blocked-uri":"inline","status-code":200}}9 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/report-uri-effective-directive.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"default-src 'self'; report-uri ../resources/save-report.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports-expected.txt
r283111 r284254 14 14 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=script-blocked-sends-multiple-reports-report-only 15 15 === POST DATA === 16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src http://example.com 'unsafe-inline'; report-uri ../resources/save-report.py?test=script-blocked-sends-multiple-reports-report-only","blocked-uri":"http://localhost:8000","status-code":200}}16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src http://example.com 'unsafe-inline'; report-uri ../resources/save-report.py?test=script-blocked-sends-multiple-reports-report-only","blocked-uri":"http://localhost:8000","status-code":200}} 17 17 18 18 -------- … … 26 26 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=script-blocked-sends-multiple-reports-enforced-1 27 27 === POST DATA === 28 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src http://127.0.0.1:8000 'unsafe-inline'; report-uri ../resources/save-report.py?test=script-blocked-sends-multiple-reports-enforced-1","blocked-uri":"http://localhost:8000","status-code":200}}28 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src http://127.0.0.1:8000 'unsafe-inline'; report-uri ../resources/save-report.py?test=script-blocked-sends-multiple-reports-enforced-1","blocked-uri":"http://localhost:8000","status-code":200}} 29 29 30 30 -------- … … 38 38 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=script-blocked-sends-multiple-reports-enforced-2 39 39 === POST DATA === 40 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":" script-src http://127.0.0.1:8000 https://127.0.0.1:8443 'unsafe-inline'; report-uri ../resources/save-report.py?test=script-blocked-sends-multiple-reports-enforced-2","blocked-uri":"http://localhost:8000","status-code":200}}40 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":" script-src http://127.0.0.1:8000 https://127.0.0.1:8443 'unsafe-inline'; report-uri ../resources/save-report.py?test=script-blocked-sends-multiple-reports-enforced-2","blocked-uri":"http://localhost:8000","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt
r284067 r284254 14 14 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.py 15 15 === POST DATA === 16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.py","blocked-uri":"inline","status-code":200}}16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt
r284067 r284254 14 14 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.py 15 15 === POST DATA === 16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.py","blocked-uri":"inline","status-code":200}}16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt
r284067 r284254 14 14 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.py 15 15 === POST DATA === 16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.py","blocked-uri":"inline","status-code":200}}16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt
r284067 r284254 14 14 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.py 15 15 === POST DATA === 16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.py","blocked-uri":"inline","status-code":200}}16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt
r284067 r284254 16 16 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.py 17 17 === POST DATA === 18 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.py","blocked-uri":"inline","status-code":200}}18 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt
r284067 r284254 14 14 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.py 15 15 === POST DATA === 16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.py","blocked-uri":"inline","status-code":200}}16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt
r284067 r284254 14 14 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.py 15 15 === POST DATA === 16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.py","blocked-uri":"inline","status-code":200}}16 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'sha256-33badf00d3badf00d3badf00d3badf00d3badf00d33=' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt
r284067 r284254 17 17 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.py 18 18 === POST DATA === 19 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'nonce-that-is-not-equal-to-dummy' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.py","blocked-uri":"inline","status-code":200}}19 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'nonce-that-is-not-equal-to-dummy' 'nonce-dump-as-text'; report-uri ../resources/save-report.py?test=/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-child-src-expected.txt
r283111 r284254 9 9 PASS window.e.referrer is "" 10 10 PASS window.e.blockedURI is "http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.html" 11 PASS window.e.violatedDirective is " child-src"11 PASS window.e.violatedDirective is "frame-src" 12 12 PASS window.e.effectiveDirective is "child-src" 13 13 PASS window.e.originalPolicy is "child-src 'none'" -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-child-src.html
r283111 r284254 12 12 "referrer": document.referrer, 13 13 "blockedURI": "http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.html", 14 "violatedDirective": " child-src",14 "violatedDirective": "frame-src", 15 15 "effectiveDirective": "child-src", 16 16 "originalPolicy": "child-src 'none'", -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-default-src-expected.txt
r283111 r284254 9 9 PASS window.e.referrer is "" 10 10 PASS window.e.blockedURI is "http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.html" 11 PASS window.e.violatedDirective is " default-src"11 PASS window.e.violatedDirective is "frame-src" 12 12 PASS window.e.effectiveDirective is "child-src" 13 13 PASS window.e.originalPolicy is "default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'" -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/securityviolationpolicy-block-frame-using-default-src.html
r283111 r284254 12 12 "referrer": document.referrer, 13 13 "blockedURI": "http://127.0.0.1:8000/security/contentSecurityPolicy/resources/alert-fail.html", 14 "violatedDirective": " default-src",14 "violatedDirective": "frame-src", 15 15 "effectiveDirective": "child-src", 16 16 "originalPolicy": "default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'", -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt
r284067 r284254 9 9 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py 10 10 === POST DATA === 11 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-and-enforce.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}}11 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-and-enforce.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-only-expected.txt
r284067 r284254 8 8 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py 9 9 === POST DATA === 10 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-only.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}}10 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-only.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt
r284067 r284254 8 8 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py 9 9 === POST DATA === 10 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-only-from-header.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}}10 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-only-from-header.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-only-upgrade-insecure-expected.txt
r284067 r284254 9 9 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py 10 10 === POST DATA === 11 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-only-upgrade-insecure.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'self'; upgrade-insecure-requests; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}}11 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-only-upgrade-insecure.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'self'; upgrade-insecure-requests; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https-expected.txt
r284067 r284254 14 14 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html 15 15 === POST DATA === 16 {"csp-report":{"document-uri":"https://127.0.0.1:8443/security/contentSecurityPolicy/resources/generate-csp-report.py?test=/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html","referrer":"http://127.0.0.1:8000/","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri save-report.py?test=/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html","blocked-uri":"inline","status-code":0}}16 {"csp-report":{"document-uri":"https://127.0.0.1:8443/security/contentSecurityPolicy/resources/generate-csp-report.py?test=/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html","referrer":"http://127.0.0.1:8000/","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri save-report.py?test=/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html","blocked-uri":"inline","status-code":0}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-expected.txt
r284067 r284254 7 7 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py 8 8 === POST DATA === 9 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-uri.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}}9 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-uri.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri resources/save-report.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt
r284067 r284254 12 12 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/report-uri-from-child-frame.html 13 13 === POST DATA === 14 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/resources/generate-csp-report.py?test=/security/contentSecurityPolicy/report-uri-from-child-frame.html","referrer":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-uri-from-child-frame.html","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri save-report.py?test=/security/contentSecurityPolicy/report-uri-from-child-frame.html","blocked-uri":"inline","status-code":200}}14 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/resources/generate-csp-report.py?test=/security/contentSecurityPolicy/report-uri-from-child-frame.html","referrer":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-uri-from-child-frame.html","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri save-report.py?test=/security/contentSecurityPolicy/report-uri-from-child-frame.html","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-scheme-relative-expected.txt
r284067 r284254 7 7 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py 8 8 === POST DATA === 9 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-uri-scheme-relative.py","referrer":"","violated-directive":"script-src ","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri //127.0.0.1:8080/security/contentSecurityPolicy/resources/save-report.py","blocked-uri":"inline","status-code":200}}9 {"csp-report":{"document-uri":"http://127.0.0.1:8000/security/contentSecurityPolicy/report-uri-scheme-relative.py","referrer":"","violated-directive":"script-src-elem","effective-directive":"script-src","original-policy":"script-src 'self'; report-uri //127.0.0.1:8080/security/contentSecurityPolicy/resources/save-report.py","blocked-uri":"inline","status-code":200}} -
trunk/LayoutTests/imported/w3c/ChangeLog
r284241 r284254 1 2021-10-15 Kate Cheney <katherine_cheney@apple.com> 2 3 CSP: Implement src-elem and src-attr directives 4 https://bugs.webkit.org/show_bug.cgi?id=231751 5 <rdar://problem/83332874> 6 7 Reviewed by Brent Fulgham. 8 9 * web-platform-tests/content-security-policy/child-src/child-src-blocked.sub-expected.txt: 10 * web-platform-tests/content-security-policy/child-src/child-src-redirect-blocked.sub-expected.txt: 11 * web-platform-tests/content-security-policy/default-src-inline-blocked.sub-expected.txt: Added. 12 * web-platform-tests/content-security-policy/default-src/default-src-inline-blocked.sub-expected.txt: 13 * web-platform-tests/content-security-policy/generic/generic-0_1-img-src-expected.txt: 14 * web-platform-tests/content-security-policy/generic/generic-0_1-script-src-expected.txt: 15 * web-platform-tests/content-security-policy/meta/combine-header-and-meta-policies.sub-expected.txt: 16 * web-platform-tests/content-security-policy/navigation/javascript-url-navigation-inherits-csp-expected.txt: 17 * web-platform-tests/content-security-policy/navigation/to-javascript-parent-initiated-parent-csp-expected.txt: 18 * web-platform-tests/content-security-policy/reporting/report-uri-effective-directive-expected.txt: 19 * web-platform-tests/content-security-policy/script-src-attr-elem/script-src-attr-allowed-src-blocked-expected.txt: 20 * web-platform-tests/content-security-policy/script-src-attr-elem/script-src-attr-blocked-src-allowed-expected.txt: 21 * web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-allowed-attr-blocked-expected.txt: 22 * web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-allowed-src-blocked-expected.txt: 23 * web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-blocked-attr-allowed-expected.txt: 24 * web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-blocked-src-allowed-expected.txt: 25 * web-platform-tests/content-security-policy/script-src/injected-inline-script-blocked.sub-expected.txt: 26 * web-platform-tests/content-security-policy/script-src/script-src-1_1-expected.txt: 27 * web-platform-tests/content-security-policy/script-src/script-src-1_10-expected.txt: 28 * web-platform-tests/content-security-policy/script-src/script-src-1_2-expected.txt: 29 * web-platform-tests/content-security-policy/script-src/script-src-1_2_1-expected.txt: 30 * web-platform-tests/content-security-policy/script-src/script-src-report-only-policy-works-with-hash-policy-expected.txt: 31 * web-platform-tests/content-security-policy/script-src/scriptnonce-and-scripthash.sub-expected.txt: 32 * web-platform-tests/content-security-policy/script-src/scriptnonce-basic-blocked.sub-expected.txt: 33 * web-platform-tests/content-security-policy/script-src/scriptnonce-ignore-unsafeinline.sub-expected.txt: 34 * web-platform-tests/content-security-policy/script-src/srcdoc-doesnt-bypass-script-src.sub-expected.txt: 35 * web-platform-tests/content-security-policy/style-src-attr-elem/style-src-attr-allowed-src-blocked-expected.txt: 36 * web-platform-tests/content-security-policy/style-src-attr-elem/style-src-attr-blocked-src-allowed-expected.txt: 37 * web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-allowed-attr-blocked-expected.txt: 38 * web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-allowed-src-blocked-expected.txt: 39 * web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-blocked-attr-allowed-expected.txt: 40 * web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-blocked-src-allowed-expected.txt: 41 * web-platform-tests/content-security-policy/style-src/injected-inline-script-blocked.sub-expected.txt: Added. 42 * web-platform-tests/content-security-policy/style-src/injected-inline-style-blocked.sub-expected.txt: 43 * web-platform-tests/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub-expected.txt: 44 * web-platform-tests/content-security-policy/style-src/inline-style-attribute-blocked-expected.txt: Added. 45 * web-platform-tests/content-security-policy/style-src/inline-style-attribute-blocked.sub-expected.txt: 46 * web-platform-tests/content-security-policy/style-src/style-src-hash-blocked-expected.txt: 47 * web-platform-tests/content-security-policy/style-src/style-src-injected-inline-style-blocked-expected.txt: 48 * web-platform-tests/content-security-policy/style-src/style-src-inline-style-attribute-blocked-expected.txt: 49 * web-platform-tests/content-security-policy/style-src/style-src-inline-style-blocked-expected.txt: 50 * web-platform-tests/content-security-policy/style-src/style-src-inline-style-nonce-blocked-expected.txt: 51 * web-platform-tests/content-security-policy/style-src/stylehash-basic-blocked.sub-expected.txt: 52 * web-platform-tests/content-security-policy/style-src/stylenonce-allowed.sub-expected.txt: 53 * web-platform-tests/content-security-policy/style-src/stylenonce-blocked.sub-expected.txt: 54 * web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-href-expected.txt: 55 * web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-href_blank-expected.txt: 56 * web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-window_open-expected.txt: 57 * web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-href-expected.txt: 58 * web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-href_blank-expected.txt: 59 * web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-window_open-expected.txt: 60 * web-platform-tests/content-security-policy/unsafe-hashes/script_event_handlers_denied_missing_unsafe_hashes-expected.txt: 61 * web-platform-tests/content-security-policy/unsafe-hashes/script_event_handlers_denied_wrong_hash-expected.txt: 62 * web-platform-tests/content-security-policy/unsafe-hashes/style_attribute_denied_missing_unsafe_hashes-expected.txt: 63 * web-platform-tests/content-security-policy/unsafe-hashes/style_attribute_denied_wrong_hash-expected.txt: 64 * web-platform-tests/content-security-policy/blob/blob-urls-do-not-match-self.sub-expected.txt: 65 * web-platform-tests/content-security-policy/generic/generic-0_10_1.sub-expected.txt: 66 * web-platform-tests/content-security-policy/generic/generic-0_2_2.sub-expected.txt: 67 * web-platform-tests/content-security-policy/generic/generic-0_2_3-expected.txt: 68 * web-platform-tests/content-security-policy/script-src/script-src-report-only-policy-works-with-external-hash-policy-expected.txt: 69 * web-platform-tests/content-security-policy/style-src/style-blocked.sub-expected.txt: 70 * web-platform-tests/content-security-policy/style-src/style-src-imported-style-blocked-expected.txt: 71 * web-platform-tests/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub-expected.txt: 72 * web-platform-tests/content-security-policy/style-src/style-src-none-blocked-expected.txt: 73 * web-platform-tests/content-security-policy/style-src/style-src-stylesheet-nonce-blocked-expected.txt: 74 * web-platform-tests/content-security-policy/svg/svg-inline.sub-expected.txt: 75 1 76 2021-10-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 77 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/blob/blob-urls-do-not-match-self.sub-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Expecting logs: ["violated-directive=script-src-elem"] assert_unreached: unexpected log: violated-directive=script-src Reached unreachable code 4 PASS Expecting logs: ["violated-directive=script-src-elem"] 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/child-src/child-src-blocked.sub-expected.txt
r283111 r284254 3 3 4 4 5 FAIL Expecting logs: ["PASS IFrame #1 generated a load event.", "violated-directive=frame-src"] assert_unreached: unexpected log: violated-directive=child-src Reached unreachable code 5 PASS Expecting logs: ["PASS IFrame #1 generated a load event.", "violated-directive=frame-src"] 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/child-src/child-src-redirect-blocked.sub-expected.txt
r283111 r284254 3 3 4 4 5 FAIL Expecting logs: ["PASS IFrame #1 generated a load event.", "violated-directive=frame-src"] assert_unreached: unexpected log: violated-directive=child-src Reached unreachable code 5 PASS Expecting logs: ["PASS IFrame #1 generated a load event.", "violated-directive=frame-src"] 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/default-src/default-src-inline-blocked.sub-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Expecting logs: ["violated-directive=script-src-elem","violated-directive=script-src-elem"] assert_unreached: unexpected log: violated-directive=default-src Reached unreachable code 4 PASS Expecting logs: ["violated-directive=script-src-elem","violated-directive=script-src-elem"] 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_1-img-src-expected.txt
r283111 r284254 3 3 4 4 PASS Verify cascading of default-src to img-src policy 5 FAIL Should fire violation events for every failed violation assert_equals: expected "img-src" but got "default-src" 5 PASS Should fire violation events for every failed violation 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_1-script-src-expected.txt
r283111 r284254 4 4 PASS Verify cascading of default-src to script-src policy: block 5 5 PASS Verify cascading of default-src to script-src policy: allow 6 FAIL Should fire violation events for every failed violation assert_equals: expected "script-src-elem" but got "default-src" 6 PASS Should fire violation events for every failed violation 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_10_1.sub-expected.txt
r283111 r284254 3 3 4 4 PASS Prevents access to external scripts. 5 FAIL Should fire violation events for every failed violation assert_equals: expected "script-src-elem" but got "script-src" 5 PASS Should fire violation events for every failed violation 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_2_2.sub-expected.txt
r283111 r284254 3 3 4 4 PASS Prevents access to external scripts. 5 FAIL Should fire violation events for every failed violation assert_equals: expected "script-src-elem" but got "script-src" 5 PASS Should fire violation events for every failed violation 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/generic/generic-0_2_3-expected.txt
r283111 r284254 3 3 4 4 PASS Prevents access to external scripts. 5 FAIL Should fire violation events for every failed violation assert_equals: expected "script-src-elem" but got "script-src" 5 PASS Should fire violation events for every failed violation 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/meta/combine-header-and-meta-policies.sub-expected.txt
r283111 r284254 3 3 4 4 5 FAIL Expecting logs: ["TEST COMPLETE", "violated-directive=img-src", "violated-directive=style-src-elem"] assert_unreached: unexpected log: violated-directive=style-src Reached unreachable code 5 PASS Expecting logs: ["TEST COMPLETE", "violated-directive=img-src", "violated-directive=style-src-elem"] 6 6 PASS combine-header-and-meta-policies 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/navigation/javascript-url-navigation-inherits-csp-expected.txt
r283111 r284254 1 1 2 FAIL Violation report status OK. assert_true: violated-directive value of "default-src" did not match frame-src. expected true got false 2 PASS Violation report status OK. 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/navigation/to-javascript-parent-initiated-parent-csp-expected.txt
r284067 r284254 1 1 2 2 3 FAIL Should not have executed the javascript url assert_equals: expected "script-src-attr" but got "script-src" 3 PASS Should not have executed the javascript url 4 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/reporting/report-uri-effective-directive-expected.txt
r283111 r284254 1 1 2 FAIL Violation report status OK. assert_true: violated-directive value of "default-src" did not match script-src. expected true got false 2 PASS Violation report status OK. 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-attr-allowed-src-blocked-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-attr'.2 3 CONSOLE MESSAGE: Refused to execute a script for an inline event handler because 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.4 1 5 2 6 Harness Error (TIMEOUT), message = null 3 PASS Should not fire a security policy violation event 7 4 8 NOTRUN Should not fire a security policy violation event9 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-attr-blocked-src-allowed-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-attr'.2 1 3 2 3 PASS Should fire a security policy violation event 4 4 5 Harness Error (TIMEOUT), message = null6 7 NOTRUN Should fire a security policy violation event8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-allowed-attr-blocked-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-elem'.2 3 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-attr'.4 1 5 2 6 7 Harness Error (TIMEOUT), message = null 8 9 NOTRUN Should fire a security policy violation for the attribute 3 PASS Should fire a security policy violation for the attribute 10 4 PASS Should execute the inline script block 11 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-allowed-src-blocked-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-elem'.2 1 3 CONSOLE MESSAGE: 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 PASS Should not fire a security policy violation event 4 3 5 Harness Error (TIMEOUT), message = null6 7 NOTRUN Should not fire a security policy violation event8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-blocked-attr-allowed-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-elem'.2 3 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-attr'.4 1 5 2 6 7 Harness Error (TIMEOUT), message = null 8 9 NOTRUN Should fire a security policy violation for the attribute 3 PASS Should fire a security policy violation for the attribute 10 4 PASS Should execute the inline script attribute 11 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src-attr-elem/script-src-elem-blocked-src-allowed-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-elem'.2 1 2 PASS Should fire a spv event 3 3 4 Harness Error (TIMEOUT), message = null5 6 NOTRUN Should fire a spv event7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/injected-inline-script-blocked.sub-expected.txt
r283111 r284254 1 1 2 FAIL Expecting logs: ["violated-directive=script-src-elem","blocked-uri=inline"] assert_unreached: unexpected log: violated-directive=script-src Reached unreachable code 2 PASS Expecting logs: ["violated-directive=script-src-elem","blocked-uri=inline"] 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-1_1-expected.txt
r283111 r284254 4 4 PASS Inline script block 5 5 PASS Inline event handler 6 FAIL Should fire policy violation events assert_unreached: Unexpected directive broken Reached unreachable code 6 PASS Should fire policy violation events 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-1_10-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Test that securitypolicyviolation event is fired assert_equals: expected "script-src-elem" but got "default-src" 4 PASS Test that securitypolicyviolation event is fired 5 5 PASS Verify that data: as script src doesn't run with this policy 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-1_2-expected.txt
r283111 r284254 4 4 PASS Inline script block 5 5 PASS Inline event handler 6 FAIL Should fire policy violation events assert_unreached: Unexpected directive broken Reached unreachable code 6 PASS Should fire policy violation events 7 7 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-1_2_1-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Test that securitypolicyviolation event is fired assert_equals: expected "script-src-elem" but got "script-src" 4 PASS Test that securitypolicyviolation event is fired 5 5 PASS DOM manipulation inline tests 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-report-only-policy-works-with-external-hash-policy-expected.txt
r283111 r284254 1 1 2 FAIL Should fire securitypolicyviolation event assert_equals: expected " script-src-elem" but got "script-src"2 FAIL Should fire securitypolicyviolation event assert_equals: expected "report" but got "enforce" 3 3 FAIL External script in a script tag with matching SRI hash should run. assert_true: External script ran. expected true got false 4 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-report-only-policy-works-with-hash-policy-expected.txt
r283111 r284254 1 1 2 2 PASS Test that script executes if allowed by proper hash values 3 FAIL Test that the securitypolicyviolation event is fired assert_equals: expected "script-src-elem" but got "script-src" 3 PASS Test that the securitypolicyviolation event is fired 4 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/scriptnonce-and-scripthash.sub-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Expecting alerts: ["PASS (1/3)","PASS (2/3)","PASS (3/3)"] assert_unreached: unexpected alert: violated-directive=script-src Reached unreachable code 4 PASS Expecting alerts: ["PASS (1/3)","PASS (2/3)","PASS (3/3)"] 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/scriptnonce-basic-blocked.sub-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Expecting alerts: ["PASS (closely-quoted nonce)","PASS (nonce w/whitespace)", "violated-directive=script-src-elem", "violated-directive=script-src-elem", "violated-directive=script-src-elem"] assert_unreached: unexpected alert: violated-directive=script-src Reached unreachable code 4 PASS Expecting alerts: ["PASS (closely-quoted nonce)","PASS (nonce w/whitespace)", "violated-directive=script-src-elem", "violated-directive=script-src-elem", "violated-directive=script-src-elem"] 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/scriptnonce-ignore-unsafeinline.sub-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Expecting alerts: ["PASS (1/2)","PASS (2/2)", "violated-directive=script-src-elem"] assert_unreached: unexpected alert: violated-directive=script-src Reached unreachable code 4 PASS Expecting alerts: ["PASS (1/2)","PASS (2/2)", "violated-directive=script-src-elem"] 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/srcdoc-doesnt-bypass-script-src.sub-expected.txt
r283111 r284254 1 1 2 2 3 FAIL Expecting logs: ["violated-directive=script-src-elem"] assert_unreached: unexpected log: violated-directive=script-src Reached unreachable code 3 PASS Expecting logs: ["violated-directive=script-src-elem"] 4 4 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-attr-allowed-src-blocked-expected.txt
r246330 r284254 1 1 2 FAIL Should apply the style attribute assert_true: expected true got false2 PASS Should apply the style attribute 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-attr-blocked-src-allowed-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'style-src-attr'.2 1 2 PASS Should fire a security policy violation event 3 PASS The attribute style should not be applied 3 4 4 Harness Error (TIMEOUT), message = null5 6 NOTRUN Should fire a security policy violation event7 FAIL The attribute style should not be applied assert_equals: expected 0 but got 108 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-allowed-attr-blocked-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'style-src-elem'.2 1 3 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'style-src-attr'. 2 PASS Should fire a security policy violation for the attribute 3 PASS The attribute style should not be applied and the inline style should be applied 4 4 5 6 Harness Error (TIMEOUT), message = null7 8 NOTRUN Should fire a security policy violation for the attribute9 FAIL The attribute style should not be applied and the inline style should be applied assert_equals: expected 0 but got 1010 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-allowed-src-blocked-expected.txt
r246330 r284254 1 1 2 FAIL Inline style should be applied assert_equals: expected 1 but got 0 2 PASS Inline style should be applied 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-blocked-attr-allowed-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'style-src-elem'.2 1 3 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'script-src-attr'. 2 PASS Should fire a security policy violation for the inline block 3 PASS The inline style should not be applied and the attribute style should be applied 4 4 5 6 Harness Error (TIMEOUT), message = null7 8 NOTRUN Should fire a security policy violation for the inline block9 FAIL The inline style should not be applied and the attribute style should be applied assert_equals: expected 0 but got 110 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src-attr-elem/style-src-elem-blocked-src-allowed-expected.txt
r267651 r284254 1 CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'style-src-elem'.2 1 2 PASS Should fire a security policy violation event 3 PASS The inline style should not be applied 3 4 4 Harness Error (TIMEOUT), message = null5 6 NOTRUN Should fire a security policy violation event7 FAIL The inline style should not be applied assert_equals: expected 0 but got 18 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/injected-inline-style-blocked.sub-expected.txt
r283111 r284254 2 2 PASS 2/2 3 3 4 FAIL Expecting logs: ["violated-directive=style-src-elem","PASS"] assert_unreached: unexpected log: violated-directive=style-src Reached unreachable code 4 PASS Expecting logs: ["violated-directive=style-src-elem","PASS"] 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub-expected.txt
r283111 r284254 9 9 Yet another div. 10 10 11 FAIL Test that violation report event was fired assert_equals: expected "style-src-attr" but got "style-src" 11 PASS Test that violation report event was fired 12 12 PASS inline-style-allowed-while-cloning-objects 13 13 FAIL inline-style-allowed-while-cloning-objects 1 null is not an object (evaluating 'node2.style.background.match(/yellow/)[0]') -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/inline-style-attribute-blocked.sub-expected.txt
r283111 r284254 1 1 2 FAIL Expecting logs: ["violated-directive=style-src-attr","PASS"] assert_unreached: unexpected log: violated-directive=style-src Reached unreachable code 2 PASS Expecting logs: ["violated-directive=style-src-attr","PASS"] 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-blocked.sub-expected.txt
r283111 r284254 1 1 2 FAIL Expecting logs: ["violated-directive=style-src-elem","PASS"] assert_unreached: unexpected log: violated-directive=style-src Reached unreachable code 2 PASS Expecting logs: ["violated-directive=style-src-elem","PASS"] 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-hash-blocked-expected.txt
r283111 r284254 2 2 PASS Should load the style with a correct hash 3 3 PASS Should not load style that does not match hash 4 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-elem" 4 PASS Should fire a securitypolicyviolation event 5 5 Lorem ipsum 6 6 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-imported-style-blocked-expected.txt
r283111 r284254 1 1 2 2 PASS @import stylesheet should not load because it does not match style-src 3 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-elem" 3 PASS Should fire a securitypolicyviolation event 4 4 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-injected-inline-style-blocked-expected.txt
r283111 r284254 1 1 2 2 PASS Injected style attributes should not be applied 3 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-elem" 3 PASS Should fire a securitypolicyviolation event 4 4 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-injected-stylesheet-blocked.sub-expected.txt
r283111 r284254 1 1 2 2 PASS Programatically injected stylesheet should not load 3 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-elem" 3 PASS Should fire a securitypolicyviolation event 4 4 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-attribute-blocked-expected.txt
r283111 r284254 1 1 2 2 PASS Inline style attribute should not be applied without 'unsafe-inline' 3 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-attr" 3 PASS Should fire a securitypolicyviolation event 4 4 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-blocked-expected.txt
r283111 r284254 1 1 2 2 PASS Inline style element should not load without 'unsafe-inline' 3 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-elem" 3 PASS Should fire a securitypolicyviolation event 4 4 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-nonce-blocked-expected.txt
r283111 r284254 1 1 2 2 PASS Should not load inline style element with invalid nonce 3 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-elem" 3 PASS Should fire a securitypolicyviolation event 4 4 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-none-blocked-expected.txt
r283111 r284254 1 1 2 2 PASS Should not stylesheet when style-src is 'none' 3 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-elem" 3 PASS Should fire a securitypolicyviolation event 4 4 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-stylesheet-nonce-blocked-expected.txt
r283111 r284254 1 1 2 2 PASS Should not load stylesheet without correct nonce 3 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src" but got "style-src-elem" 3 PASS Should fire a securitypolicyviolation event 4 4 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/stylehash-basic-blocked.sub-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Expecting alerts: ["PASS: The 'p' element's text is green, which means the style was correctly applied.", "violated-directive=style-src-elem"] assert_unreached: unexpected alert: violated-directive=style-src Reached unreachable code 4 PASS Expecting alerts: ["PASS: The 'p' element's text is green, which means the style was correctly applied.", "violated-directive=style-src-elem"] 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/stylenonce-allowed.sub-expected.txt
r283111 r284254 6 6 7 7 8 FAIL Should fire securitypolicyviolation assert_equals: expected "style-src-elem" but got "style-src" 8 PASS Should fire securitypolicyviolation 9 9 PASS stylenonce-allowed 10 10 PASS stylenonce-allowed 1 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/stylenonce-blocked.sub-expected.txt
r283111 r284254 4 4 5 5 6 FAIL Should fire securitypolicyviolation assert_equals: expected "style-src-elem" but got "style-src" 6 PASS Should fire securitypolicyviolation 7 7 PASS stylenonce-blocked 8 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/svg/svg-inline.sub-expected.txt
r283111 r284254 2 2 3 3 4 FAIL Should fire violation event assert_equals: expected "script-src-elem" but got "script-src" 4 PASS Should fire violation event 5 5 PASS 6 6 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-href-expected.txt
r283111 r284254 1 1 2 FAIL Test that the javascript: src is not allowed to run assert_equals: expected "script-src-elem" but got "script-src" 2 PASS Test that the javascript: src is not allowed to run 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-href_blank-expected.txt
r283111 r284254 1 1 2 FAIL Test that the javascript: src is not allowed to run assert_equals: expected "script-src-elem" but got "script-src" 2 PASS Test that the javascript: src is not allowed to run 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_missing_unsafe_hashes-window_open-expected.txt
r283111 r284254 1 1 2 FAIL Test that the javascript: src is not allowed to run assert_equals: expected "script-src-elem" but got "script-src" 2 PASS Test that the javascript: src is not allowed to run 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-href-expected.txt
r283111 r284254 1 1 2 FAIL Test that the javascript: src is not allowed to run assert_equals: expected "script-src-elem" but got "script-src" 2 PASS Test that the javascript: src is not allowed to run 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-href_blank-expected.txt
r283111 r284254 1 1 2 FAIL Test that the javascript: src is not allowed to run assert_equals: expected "script-src-elem" but got "script-src" 2 PASS Test that the javascript: src is not allowed to run 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/javascript_src_denied_wrong_hash-window_open-expected.txt
r283111 r284254 1 1 2 FAIL Test that the javascript: src is not allowed to run assert_equals: expected "script-src-elem" but got "script-src" 2 PASS Test that the javascript: src is not allowed to run 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/script_event_handlers_denied_missing_unsafe_hashes-expected.txt
r283111 r284254 1 1 2 FAIL Test that the inline event handler is not allowed to run assert_equals: expected "script-src-attr" but got "script-src" 2 PASS Test that the inline event handler is not allowed to run 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/script_event_handlers_denied_wrong_hash-expected.txt
r283111 r284254 1 1 2 FAIL Test that the inline event handler is not allowed to run assert_equals: expected "script-src-attr" but got "script-src" 2 PASS Test that the inline event handler is not allowed to run 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/style_attribute_denied_missing_unsafe_hashes-expected.txt
r283111 r284254 1 1 2 FAIL Test that the inline style attribute is blocked assert_equals: expected "style-src-attr" but got "style-src" 2 PASS Test that the inline style attribute is blocked 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/unsafe-hashes/style_attribute_denied_wrong_hash-expected.txt
r283111 r284254 1 1 2 FAIL Test that the inline style attribute is blocked assert_equals: expected "style-src-attr" but got "style-src" 2 PASS Test that the inline style attribute is blocked 3 3 -
trunk/Source/WebCore/ChangeLog
r284247 r284254 1 2021-10-15 Kate Cheney <katherine_cheney@apple.com> 2 3 CSP: Implement src-elem and src-attr directives 4 https://bugs.webkit.org/show_bug.cgi?id=231751 5 <rdar://problem/83332874> 6 7 Reviewed by Brent Fulgham. 8 9 Implement script-src-elem, script-src-attr, style-src-elem, and 10 style-src-attr directives. *-elem directives specify load policy for 11 <script> and <style> elements. *-attr directives specify load policy 12 for inline event handlers or inline style applied to individual DOM elements. 13 14 To match behavior of wpt tests and other browsers, we should report 15 the violated directive as accurately as possible even if a more 16 general directive was specified in the policy. For example, reporting 17 the violated directive as script-src even if default-src was 18 specified, and script-src-elem even if only script-src was specified. 19 To do this I added a nameForReporting() method in the 20 ContentSecurityPolicySourceListDirective class that gets set when we 21 check the load for violations. 22 23 Console messages should not change, in fact, we should consider making 24 them more specific in the future. 25 26 * page/csp/ContentSecurityPolicy.cpp: 27 (WebCore::ContentSecurityPolicy::allowJavaScriptURLs const): 28 (WebCore::ContentSecurityPolicy::allowInlineEventHandlers const): 29 (WebCore::ContentSecurityPolicy::allowInlineScript const): 30 (WebCore::ContentSecurityPolicy::allowInlineStyle const): 31 We can reuse the check for unsafe hashes to determine if we should 32 report a style-src-elem or style-src-attr violation. 33 34 (WebCore::ContentSecurityPolicy::reportViolation const): 35 * page/csp/ContentSecurityPolicyDirective.cpp: 36 (WebCore::ContentSecurityPolicyDirective::~ContentSecurityPolicyDirective): 37 Need a destructor now that we have virtual functions. 38 39 * page/csp/ContentSecurityPolicyDirective.h: 40 (WebCore::ContentSecurityPolicyDirective::nameForReporting const): 41 * page/csp/ContentSecurityPolicyDirectiveList.cpp: 42 (WebCore::ContentSecurityPolicyDirectiveList::create): 43 unsafe-eval should still have script-src as a violated directive. 44 45 (WebCore::ContentSecurityPolicyDirectiveList::operativeDirective const): 46 (WebCore::ContentSecurityPolicyDirectiveList::operativeDirectiveScript const): 47 (WebCore::ContentSecurityPolicyDirectiveList::operativeDirectiveStyle const): 48 elem/attr directives fall back to their respective general directives 49 if the more specific ones do not exist. 50 51 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeEval const): 52 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript const): 53 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashStyle const): 54 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForParserInsertedScript const): 55 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement const): 56 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptAttribute const): 57 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleElement const): 58 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleAttribute const): 59 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash const): 60 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash const): 61 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptNonce const): 62 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleNonce const): 63 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForChildContext const): 64 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForConnectSource const): 65 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFont const): 66 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame const): 67 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForImage const): 68 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForManifest const): 69 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForMedia const): 70 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource const): 71 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScript const): 72 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle const): 73 (WebCore::ContentSecurityPolicyDirectiveList::addDirective): 74 (WebCore::ContentSecurityPolicyDirectiveList::strictDynamicIncluded): 75 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScript const): Deleted. 76 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyle const): Deleted. 77 * page/csp/ContentSecurityPolicyDirectiveList.h: 78 * page/csp/ContentSecurityPolicyDirectiveNames.cpp: 79 * page/csp/ContentSecurityPolicyDirectiveNames.h: 80 * page/csp/ContentSecurityPolicySourceListDirective.h: 81 (WebCore::ContentSecurityPolicySourceListDirective::setNameForReporting): 82 1 83 2021-10-15 Simon Fraser <simon.fraser@apple.com> 2 84 -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
r284080 r284254 412 412 }; 413 413 414 return checkHashAndReportViolation(source, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScript , &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript, m_hashAlgorithmsForInlineScripts, handleViolatedDirective);414 return checkHashAndReportViolation(source, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript, m_hashAlgorithmsForInlineScripts, handleViolatedDirective); 415 415 } 416 416 … … 429 429 }; 430 430 431 return checkHashAndReportViolation(source, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScript , &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript, m_hashAlgorithmsForInlineScripts, handleViolatedDirective);431 return checkHashAndReportViolation(source, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptAttribute, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript, m_hashAlgorithmsForInlineScripts, handleViolatedDirective); 432 432 } 433 433 … … 472 472 auto handleViolatedDirective = [&] (const ContentSecurityPolicyDirective& violatedDirective) { 473 473 TextPosition sourcePosition(WTF::OrdinalNumber::beforeFirst(), WTF::OrdinalNumber()); 474 String consoleMessage = consoleMessageForViolation(ContentSecurityPolicyDirectiveNames::scriptSrcElem, violatedDirective, url, "Refused to load"); 475 // FIXME: (rdar://83332874) implement scriptSrcElem properly. 474 String consoleMessage = consoleMessageForViolation(ContentSecurityPolicyDirectiveNames::scriptSrc, violatedDirective, url, "Refused to load"); 476 475 reportViolation(ContentSecurityPolicyDirectiveNames::scriptSrcElem, violatedDirective, url.string(), consoleMessage, String(), sourcePosition); 477 476 }; … … 495 494 // FIXME: We should not report that the inline script violated a policy when its hash matched a source 496 495 // expression in the policy and the page has more than one policy. See <https://bugs.webkit.org/show_bug.cgi?id=159832>. 497 return checkHashAndReportViolation(scriptContent.toString(), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScript , &ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash, m_hashAlgorithmsForInlineScripts, handleViolatedDirective);496 return checkHashAndReportViolation(scriptContent.toString(), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement, &ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash, m_hashAlgorithmsForInlineScripts, handleViolatedDirective); 498 497 } 499 498 … … 505 504 return true; 506 505 auto handleViolatedDirective = [&] (const ContentSecurityPolicyDirective& violatedDirective) { 506 auto name = shouldCheckUnsafeHashes == CheckUnsafeHashes::Yes ? ContentSecurityPolicyDirectiveNames::styleSrcAttr : ContentSecurityPolicyDirectiveNames::styleSrcElem; 507 507 String consoleMessage = consoleMessageForViolation(ContentSecurityPolicyDirectiveNames::styleSrc, violatedDirective, URL(), "Refused to apply a stylesheet", "its hash, its nonce, or 'unsafe-inline'"); 508 reportViolation(ContentSecurityPolicyDirectiveNames::styleSrc, violatedDirective, "inline"_s, consoleMessage, contextURL, TextPosition(contextLine, WTF::OrdinalNumber())); 509 }; 510 511 auto searchPolicy = shouldCheckUnsafeHashes == CheckUnsafeHashes::Yes ? &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashStyle : &ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash; 508 reportViolation(name, violatedDirective, "inline"_s, consoleMessage, contextURL, TextPosition(contextLine, WTF::OrdinalNumber())); 509 }; 510 511 if (shouldCheckUnsafeHashes == CheckUnsafeHashes::Yes) 512 return checkHashAndReportViolation(styleContent.toString(), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleAttribute, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashStyle, m_hashAlgorithmsForInlineStylesheets, handleViolatedDirective); 512 513 513 514 // FIXME: We should not report that the inline stylesheet violated a policy when its hash matched a source 514 515 // expression in the policy and the page has more than one policy. See <https://bugs.webkit.org/show_bug.cgi?id=159832>. 515 return checkHashAndReportViolation(styleContent.toString(), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyle , searchPolicy, m_hashAlgorithmsForInlineStylesheets, handleViolatedDirective);516 return checkHashAndReportViolation(styleContent.toString(), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleElement, &ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash, m_hashAlgorithmsForInlineStylesheets, handleViolatedDirective); 516 517 } 517 518 … … 722 723 { 723 724 // FIXME: Extract source file and source position from JSC::ExecState. 724 return reportViolation(violatedDirective, effectiveViolatedDirective.name ().convertToASCIILowercase(), effectiveViolatedDirective.directiveList(), blockedURL, consoleMessage, String(), TextPosition(WTF::OrdinalNumber::beforeFirst(), WTF::OrdinalNumber::beforeFirst()), state);725 return reportViolation(violatedDirective, effectiveViolatedDirective.nameForReporting().convertToASCIILowercase(), effectiveViolatedDirective.directiveList(), blockedURL, consoleMessage, String(), TextPosition(WTF::OrdinalNumber::beforeFirst(), WTF::OrdinalNumber::beforeFirst()), state); 725 726 } 726 727 … … 733 734 void ContentSecurityPolicy::reportViolation(const String& effectiveViolatedDirective, const ContentSecurityPolicyDirective& violatedDirective, const String& blockedURL, const String& consoleMessage, const String& sourceURL, const TextPosition& sourcePosition, const URL& preRedirectURL, JSC::JSGlobalObject* state) const 734 735 { 735 return reportViolation(effectiveViolatedDirective, violatedDirective.name ().convertToASCIILowercase(), violatedDirective.directiveList(), blockedURL, consoleMessage, sourceURL, sourcePosition, state, preRedirectURL);736 return reportViolation(effectiveViolatedDirective, violatedDirective.nameForReporting().convertToASCIILowercase(), violatedDirective.directiveList(), blockedURL, consoleMessage, sourceURL, sourcePosition, state, preRedirectURL); 736 737 } 737 738 -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirective.cpp
r198657 r284254 31 31 namespace WebCore { 32 32 33 ContentSecurityPolicyDirective::~ContentSecurityPolicyDirective() 34 { 35 } 36 33 37 bool ContentSecurityPolicyDirective::isDefaultSrc() const 34 38 { -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirective.h
r248762 r284254 43 43 } 44 44 45 virtual ~ContentSecurityPolicyDirective() = 0; 46 45 47 const String& name() const { return m_name; } 46 48 const String& text() const { return m_text; } 49 virtual const String& nameForReporting() const { return m_name; } 47 50 48 51 const ContentSecurityPolicyDirectiveList& directiveList() const { return m_directiveList; } -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp
r284067 r284254 141 141 directives->parse(header, from); 142 142 143 if (!checkEval(directives->operativeDirective(directives->m_scriptSrc.get() ))) {144 directives->setEvalDisabledErrorMessage(makeString("Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"", directives->operativeDirective(directives->m_scriptSrc.get() )->text(), "\".\n"));145 directives->setWebAssemblyDisabledErrorMessage(makeString("Refused to create a WebAssembly object because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"", directives->operativeDirective(directives->m_scriptSrc.get() )->text(), "\".\n"));143 if (!checkEval(directives->operativeDirective(directives->m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc))) { 144 directives->setEvalDisabledErrorMessage(makeString("Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"", directives->operativeDirective(directives->m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc)->text(), "\".\n")); 145 directives->setWebAssemblyDisabledErrorMessage(makeString("Refused to create a WebAssembly object because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"", directives->operativeDirective(directives->m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc)->text(), "\".\n")); 146 146 } 147 147 … … 152 152 } 153 153 154 ContentSecurityPolicySourceListDirective* ContentSecurityPolicyDirectiveList::operativeDirective(ContentSecurityPolicySourceListDirective* directive) const 155 { 156 return directive ? directive : m_defaultSrc.get(); 154 ContentSecurityPolicySourceListDirective* ContentSecurityPolicyDirectiveList::operativeDirective(ContentSecurityPolicySourceListDirective* directive, const String& nameForReporting) const 155 { 156 if (directive) { 157 directive->setNameForReporting(nameForReporting); 158 return directive; 159 } 160 161 if (m_defaultSrc.get()) 162 m_defaultSrc.get()->setNameForReporting(nameForReporting); 163 164 return m_defaultSrc.get(); 165 } 166 167 ContentSecurityPolicySourceListDirective* ContentSecurityPolicyDirectiveList::operativeDirectiveScript(ContentSecurityPolicySourceListDirective* directive, const String& nameForReporting) const 168 { 169 if (directive) { 170 directive->setNameForReporting(nameForReporting); 171 return directive; 172 } 173 return operativeDirective(m_scriptSrc.get(), nameForReporting); 174 } 175 176 ContentSecurityPolicySourceListDirective* ContentSecurityPolicyDirectiveList::operativeDirectiveStyle(ContentSecurityPolicySourceListDirective* directive, const String& nameForReporting) const 177 { 178 if (directive) { 179 directive->setNameForReporting(nameForReporting); 180 return directive; 181 } 182 return operativeDirective(m_styleSrc.get(), nameForReporting); 157 183 } 158 184 159 185 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeEval() const 160 186 { 161 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_scriptSrc.get());187 auto* operativeDirective = this->operativeDirective(m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 162 188 if (checkEval(operativeDirective)) 163 189 return nullptr; … … 167 193 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript(const ContentSecurityPolicyHash& hash) const 168 194 { 169 auto* operativeDirective = this->operativeDirective(m_scriptSrc.get() );195 auto* operativeDirective = this->operativeDirective(m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 170 196 if (checkUnsafeHashes(operativeDirective, hash)) 171 197 return nullptr; … … 175 201 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashStyle(const ContentSecurityPolicyHash& hash) const 176 202 { 177 auto* operativeDirective = this->operativeDirective(m_styleSrc.get() );203 auto* operativeDirective = this->operativeDirective(m_styleSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 178 204 if (checkUnsafeHashes(operativeDirective, hash)) 179 205 return nullptr; … … 181 207 } 182 208 183 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScript() const 184 { 185 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_scriptSrc.get()); 209 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForParserInsertedScript(ParserInserted parserInserted) const 210 { 211 auto* operativeDirective = this->operativeDirectiveScript(m_scriptSrcElem.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 212 if (checkNonParserInsertedScripts(operativeDirective, parserInserted)) 213 return nullptr; 214 215 return operativeDirective; 216 } 217 218 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement() const 219 { 220 auto* operativeDirective = this->operativeDirectiveScript(m_scriptSrcElem.get(), ContentSecurityPolicyDirectiveNames::scriptSrcElem); 186 221 if (checkInline(operativeDirective)) 187 222 return nullptr; … … 189 224 } 190 225 191 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForParserInsertedScript(ParserInserted parserInserted) const 192 { 193 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_scriptSrc.get()); 194 if (checkNonParserInsertedScripts(operativeDirective, parserInserted)) 195 return nullptr; 196 197 return operativeDirective; 198 } 199 200 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyle() const 201 { 202 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_styleSrc.get()); 226 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptAttribute() const 227 { 228 auto* operativeDirective = this->operativeDirectiveScript(m_scriptSrcAttr.get(), ContentSecurityPolicyDirectiveNames::scriptSrcAttr); 203 229 if (checkInline(operativeDirective)) 204 230 return nullptr; … … 206 232 } 207 233 234 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleElement() const 235 { 236 auto* operativeDirective = this->operativeDirectiveStyle(m_styleSrcElem.get(), ContentSecurityPolicyDirectiveNames::styleSrcElem); 237 if (checkInline(operativeDirective)) 238 return nullptr; 239 return operativeDirective; 240 } 241 242 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleAttribute() const 243 { 244 auto* operativeDirective = this->operativeDirectiveStyle(m_styleSrcAttr.get(), ContentSecurityPolicyDirectiveNames::styleSrcAttr); 245 if (checkInline(operativeDirective)) 246 return nullptr; 247 return operativeDirective; 248 } 249 208 250 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash(const ContentSecurityPolicyHash& hash) const 209 251 { 210 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_scriptSrc.get());252 auto* operativeDirective = this->operativeDirective(m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 211 253 if (checkHash(operativeDirective, hash)) 212 254 return nullptr; … … 216 258 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash(const ContentSecurityPolicyHash& hash) const 217 259 { 218 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_styleSrc.get());260 auto* operativeDirective = this->operativeDirective(m_styleSrc.get(), ContentSecurityPolicyDirectiveNames::styleSrc); 219 261 if (checkHash(operativeDirective, hash)) 220 262 return nullptr; … … 224 266 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptNonce(const String& nonce) const 225 267 { 226 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_scriptSrc.get());268 auto* operativeDirective = this->operativeDirectiveScript(m_scriptSrcElem.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 227 269 if (checkNonce(operativeDirective, nonce)) 228 270 return nullptr; … … 232 274 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleNonce(const String& nonce) const 233 275 { 234 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_styleSrc.get());276 auto* operativeDirective = this->operativeDirectiveStyle(m_styleSrcElem.get(), ContentSecurityPolicyDirectiveNames::styleSrc); 235 277 if (checkNonce(operativeDirective, nonce)) 236 278 return nullptr; … … 247 289 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForChildContext(const URL& url, bool didReceiveRedirectResponse) const 248 290 { 249 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_childSrc.get());291 auto* operativeDirective = this->operativeDirective(m_childSrc.get(), ContentSecurityPolicyDirectiveNames::childSrc); 250 292 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 251 293 return nullptr; … … 255 297 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForConnectSource(const URL& url, bool didReceiveRedirectResponse) const 256 298 { 257 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_connectSrc.get());299 auto* operativeDirective = this->operativeDirective(m_connectSrc.get(), ContentSecurityPolicyDirectiveNames::connectSrc); 258 300 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 259 301 return nullptr; … … 263 305 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForFont(const URL& url, bool didReceiveRedirectResponse) const 264 306 { 265 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_fontSrc.get());307 auto* operativeDirective = this->operativeDirective(m_fontSrc.get(), ContentSecurityPolicyDirectiveNames::fontSrc); 266 308 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 267 309 return nullptr; … … 283 325 // We must enforce the frame-src directive (if specified) before enforcing the child-src directive for a nested browsing 284 326 // context by <https://w3c.github.io/webappsec-csp/2/#directive-child-src-nested> (29 August 2015). 285 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_frameSrc ? m_frameSrc.get() : m_childSrc.get());327 auto* operativeDirective = this->operativeDirective(m_frameSrc ? m_frameSrc.get() : m_childSrc.get(), ContentSecurityPolicyDirectiveNames::frameSrc); 286 328 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 287 329 return nullptr; … … 305 347 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForImage(const URL& url, bool didReceiveRedirectResponse) const 306 348 { 307 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_imgSrc.get());349 auto* operativeDirective = this->operativeDirective(m_imgSrc.get(), ContentSecurityPolicyDirectiveNames::imgSrc); 308 350 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 309 351 return nullptr; … … 314 356 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForManifest(const URL& url, bool didReceiveRedirectResponse) const 315 357 { 316 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_manifestSrc.get());358 auto* operativeDirective = this->operativeDirective(m_manifestSrc.get(), ContentSecurityPolicyDirectiveNames::manifestSrc); 317 359 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 318 360 return nullptr; … … 323 365 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForMedia(const URL& url, bool didReceiveRedirectResponse) const 324 366 { 325 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_mediaSrc.get());367 auto* operativeDirective = this->operativeDirective(m_mediaSrc.get(), ContentSecurityPolicyDirectiveNames::mediaSrc); 326 368 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 327 369 return nullptr; … … 333 375 if (url.protocolIsAbout()) 334 376 return nullptr; 335 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_objectSrc.get());377 auto* operativeDirective = this->operativeDirective(m_objectSrc.get(), ContentSecurityPolicyDirectiveNames::objectSrc); 336 378 if (checkSource(operativeDirective, url, didReceiveRedirectResponse, shouldAllowEmptyURLIfSourceListEmpty)) 337 379 return nullptr; … … 348 390 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForScript(const URL& url, bool didReceiveRedirectResponse) const 349 391 { 350 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_scriptSrc.get());392 auto* operativeDirective = this->operativeDirective(m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrcElem); 351 393 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 352 394 return nullptr; … … 356 398 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle(const URL& url, bool didReceiveRedirectResponse) const 357 399 { 358 ContentSecurityPolicySourceListDirective* operativeDirective = this->operativeDirective(m_styleSrc.get());400 auto* operativeDirective = this->operativeDirective(m_styleSrc.get(), ContentSecurityPolicyDirectiveNames::styleSrcElem); 359 401 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 360 402 return nullptr; … … 536 578 setCSPDirective<ContentSecurityPolicySourceListDirective>(WTFMove(directive), m_scriptSrc); 537 579 m_policy.addHashAlgorithmsForInlineScripts(m_scriptSrc->hashAlgorithmsUsed()); 580 } else if (equalIgnoringASCIICase(directive.name, ContentSecurityPolicyDirectiveNames::scriptSrcElem)) { 581 setCSPDirective<ContentSecurityPolicySourceListDirective>(WTFMove(directive), m_scriptSrcElem); 582 m_policy.addHashAlgorithmsForInlineScripts(m_scriptSrcElem->hashAlgorithmsUsed()); 583 } else if (equalIgnoringASCIICase(directive.name, ContentSecurityPolicyDirectiveNames::scriptSrcAttr)) { 584 setCSPDirective<ContentSecurityPolicySourceListDirective>(WTFMove(directive), m_scriptSrcAttr); 585 m_policy.addHashAlgorithmsForInlineScripts(m_scriptSrcAttr->hashAlgorithmsUsed()); 538 586 } else if (equalIgnoringASCIICase(directive.name, ContentSecurityPolicyDirectiveNames::styleSrc)) { 539 587 setCSPDirective<ContentSecurityPolicySourceListDirective>(WTFMove(directive), m_styleSrc); 540 588 m_policy.addHashAlgorithmsForInlineStylesheets(m_styleSrc->hashAlgorithmsUsed()); 589 } else if (equalIgnoringASCIICase(directive.name, ContentSecurityPolicyDirectiveNames::styleSrcElem)) { 590 setCSPDirective<ContentSecurityPolicySourceListDirective>(WTFMove(directive), m_styleSrcElem); 591 m_policy.addHashAlgorithmsForInlineStylesheets(m_styleSrcElem->hashAlgorithmsUsed()); 592 } else if (equalIgnoringASCIICase(directive.name, ContentSecurityPolicyDirectiveNames::styleSrcAttr)) { 593 setCSPDirective<ContentSecurityPolicySourceListDirective>(WTFMove(directive), m_styleSrcAttr); 594 m_policy.addHashAlgorithmsForInlineStylesheets(m_styleSrcAttr->hashAlgorithmsUsed()); 541 595 } else if (equalIgnoringASCIICase(directive.name, ContentSecurityPolicyDirectiveNames::objectSrc)) 542 596 setCSPDirective<ContentSecurityPolicySourceListDirective>(WTFMove(directive), m_objectSrc); … … 585 639 bool ContentSecurityPolicyDirectiveList::strictDynamicIncluded() 586 640 { 587 ContentSecurityPolicySourceListDirective* directive = this->operativeDirective (m_scriptSrc.get());641 ContentSecurityPolicySourceListDirective* directive = this->operativeDirectiveScript(m_scriptSrcElem.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 588 642 return directive && directive->allowNonParserInsertedScripts(); 589 643 } -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h
r284067 r284254 47 47 48 48 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeEval() const; 49 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineScript() const;50 49 const ContentSecurityPolicyDirective* violatedDirectiveForParserInsertedScript(ParserInserted) const; 51 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineStyle() const; 50 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineScriptElement() const; 51 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineScriptAttribute() const; 52 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineStyleElement() const; 53 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineStyleAttribute() const; 52 54 53 55 const ContentSecurityPolicyDirective* violatedDirectiveForScriptHash(const ContentSecurityPolicyHash&) const; … … 109 111 void setCSPDirective(ParsedDirective&&, std::unique_ptr<CSPDirectiveType>&); 110 112 111 ContentSecurityPolicySourceListDirective* operativeDirective(ContentSecurityPolicySourceListDirective*) const; 113 ContentSecurityPolicySourceListDirective* operativeDirective(ContentSecurityPolicySourceListDirective*, const String&) const; 114 ContentSecurityPolicySourceListDirective* operativeDirectiveScript(ContentSecurityPolicySourceListDirective*, const String&) const; 115 ContentSecurityPolicySourceListDirective* operativeDirectiveStyle(ContentSecurityPolicySourceListDirective*, const String&) const; 112 116 113 117 void setEvalDisabledErrorMessage(const String& errorMessage) { m_evalDisabledErrorMessage = errorMessage; } … … 142 146 std::unique_ptr<ContentSecurityPolicySourceListDirective> m_scriptSrc; 143 147 std::unique_ptr<ContentSecurityPolicySourceListDirective> m_styleSrc; 144 148 std::unique_ptr<ContentSecurityPolicySourceListDirective> m_scriptSrcElem; 149 std::unique_ptr<ContentSecurityPolicySourceListDirective> m_scriptSrcAttr; 150 std::unique_ptr<ContentSecurityPolicySourceListDirective> m_styleSrcElem; 151 std::unique_ptr<ContentSecurityPolicySourceListDirective> m_styleSrcAttr; 152 145 153 Vector<String> m_reportURIs; 146 154 -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.cpp
r283192 r284254 49 49 const char* const sandbox = "sandbox"; 50 50 const char* const scriptSrc = "script-src"; 51 const char* const scriptSrcAttr = "script-src-attr"; 51 52 const char* const scriptSrcElem = "script-src-elem"; 52 53 const char* const styleSrc = "style-src"; 54 const char* const styleSrcAttr = "style-src-attr"; 55 const char* const styleSrcElem = "style-src-elem"; 53 56 const char* const upgradeInsecureRequests = "upgrade-insecure-requests"; 54 57 const char* const blockAllMixedContent = "block-all-mixed-content"; -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.h
r283192 r284254 49 49 extern const char* const scriptSrc; 50 50 extern const char* const scriptSrcElem; 51 extern const char* const scriptSrcAttr; 51 52 extern const char* const styleSrc; 53 extern const char* const styleSrcAttr; 54 extern const char* const styleSrcElem; 52 55 extern const char* const upgradeInsecureRequests; 53 56 extern const char* const blockAllMixedContent; -
trunk/Source/WebCore/page/csp/ContentSecurityPolicySourceListDirective.h
r284067 r284254 49 49 OptionSet<ContentSecurityPolicyHashAlgorithm> hashAlgorithmsUsed() const { return m_sourceList.hashAlgorithmsUsed(); } 50 50 51 void setNameForReporting(const String& name) { m_nameForReporting = name; } 52 const String& nameForReporting() const final { return !m_nameForReporting.isEmpty() ? m_nameForReporting : name(); } 53 51 54 private: 55 String m_nameForReporting; 52 56 ContentSecurityPolicySourceList m_sourceList; 53 57 };
Note: See TracChangeset
for help on using the changeset viewer.