Changeset 288132 in webkit
- Timestamp:
- Jan 18, 2022 11:33:30 AM (6 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 41 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (2 diffs)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-in-enforced-policy-and-not-in-report-only-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-multiple-policies-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-in-enforced-policy-and-not-in-report-only-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-multiple-policies-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-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/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-enforced-policy-and-not-in-report-only-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/javascript-url-blocked-by-default-src-star-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/security/contentSecurityPolicy/window-open-javascript-url-with-target-blocked-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-multiple-policies-one-using-hashing-algorithms-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-strict_dynamic_parser_inserted-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-error-event-fires-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-multiple-policies-multiple-hashing-algorithms-expected.txt (added)
-
LayoutTests/platform/glib/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/js/CachedScriptFetcher.cpp (modified) (1 diff)
-
Source/WebCore/dom/InlineStyleSheetOwner.cpp (modified) (1 diff)
-
Source/WebCore/dom/ScriptElement.cpp (modified) (2 diffs)
-
Source/WebCore/dom/StyledElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLLinkElement.cpp (modified) (1 diff)
-
Source/WebCore/loader/DocumentThreadableLoader.cpp (modified) (1 diff)
-
Source/WebCore/loader/ResourceLoaderOptions.h (modified) (1 diff)
-
Source/WebCore/loader/cache/CachedResourceLoader.cpp (modified) (1 diff)
-
Source/WebCore/page/csp/ContentSecurityPolicy.cpp (modified) (11 diffs)
-
Source/WebCore/page/csp/ContentSecurityPolicy.h (modified) (4 diffs)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp (modified) (2 diffs)
-
Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r288117 r288132 1 2022-01-18 Patrick Griffis <pgriffis@igalia.com> 2 3 CSP: Improve handling of multiple policies 4 https://bugs.webkit.org/show_bug.cgi?id=235199 5 6 Reviewed by Kate Cheney. 7 8 Update test expectations, Some newly passing tests are no longer skipped and some have new reports. 9 10 * TestExpectations: 11 * http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-in-enforced-policy-and-not-in-report-only-expected.txt: 12 * http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-multiple-policies-expected.txt: 13 * http/tests/security/contentSecurityPolicy/1.1/scripthash-in-enforced-policy-and-not-in-report-only-expected.txt: 14 * http/tests/security/contentSecurityPolicy/1.1/scripthash-multiple-policies-expected.txt: 15 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt: 16 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt: 17 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: 18 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: 19 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt: 20 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy2-expected.txt: 21 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: 22 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: 23 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-enforced-policy-and-not-in-report-only-expected.txt: 24 * http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies-expected.txt: 25 * http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt: 26 * http/tests/security/contentSecurityPolicy/javascript-url-blocked-by-default-src-star-expected.txt: 27 * http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt: 28 * http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked-expected.txt: 29 * http/tests/security/contentSecurityPolicy/window-open-javascript-url-with-target-blocked-expected.txt: 30 * platform/glib/TestExpectations: 31 * platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only-expected.txt: 32 1 33 2022-01-18 Sepand Parhami <sparhami@apple.com> 2 34 -
trunk/LayoutTests/TestExpectations
r288070 r288132 968 968 # FIXME: Skip Content Security Policy tests that are dumping the render tree instead of text: 969 969 imported/w3c/web-platform-tests/content-security-policy/svg/scripted.svg [ Skip ] 970 imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-multiple-policies-one-using-hashing-algorithms.html [ Skip ]971 970 imported/w3c/web-platform-tests/content-security-policy/svg/including.sub.svg [ Skip ] 972 971 … … 1012 1011 imported/w3c/web-platform-tests/content-security-policy/reporting/multiple-report-policies.html [ Skip ] 1013 1012 imported/w3c/web-platform-tests/content-security-policy/reporting/report-cross-origin-no-cookies.sub.html [ Skip ] 1014 imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-multiple-policies-multiple-hashing-algorithms.html [ Skip ]1015 1013 1016 1014 # Content Security Policy: Embedded Enforcement is not supported 1017 1015 imported/w3c/web-platform-tests/content-security-policy/embedded-enforcement 1018 1019 # Skip some Content Security Policy script-dynamic tests as we do not fully support the feature1020 imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-strict_dynamic_parser_inserted.html [ Skip ]1021 1016 1022 1017 # Skip Content Security Policy shared workers tests as we do not support shared workers -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-in-enforced-policy-and-not-in-report-only-expected.txt
r259900 r288132 2 2 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 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. 4 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 4 5 5 6 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/module-scriptnonce-multiple-policies-expected.txt
r259900 r288132 1 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 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.3 1 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. 4 2 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. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-in-enforced-policy-and-not-in-report-only-expected.txt
r259900 r288132 1 1 CONSOLE MESSAGE: The Content Security Policy 'script-src 'none'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 2 2 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 CONSOLE MESSAGE: Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 4 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 4 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.5 5 6 6 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-multiple-policies-expected.txt
r259900 r288132 1 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 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.3 1 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. 4 2 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. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt
r203434 r288132 1 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 1 2 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt
r203434 r288132 1 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 1 2 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt
r203434 r288132 1 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 1 2 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt
r203434 r288132 1 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 1 2 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt
r284254 r288132 1 1 CONSOLE MESSAGE: The Content Security Policy 'script-src 'nonce-dummy' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 2 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.3 2 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. 4 3 CONSOLE MESSAGE: The Content Security Policy 'script-src 'nonce-dummy' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy2-expected.txt
r259900 r288132 1 1 CONSOLE MESSAGE: The Content Security Policy 'script-src 'nonce-dummy' 'nonce-dump-as-text'' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header. 2 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.3 2 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. 4 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. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt
r259829 r288132 1 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 1 2 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt
r259829 r288132 1 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 1 2 PASS did execute script. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-enforced-policy-and-not-in-report-only-expected.txt
r259900 r288132 2 2 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 3 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. 4 CONSOLE MESSAGE: [Report Only] Refused to execute a script because its hash, its nonce, or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 4 5 5 6 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies-expected.txt
r259900 r288132 1 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 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.3 1 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. 4 2 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. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/inline-script-blocked-javascript-url-expected.txt
r267644 r288132 2 2 CONSOLE MESSAGE: The 'options' directive has been replaced with 'unsafe-inline' and 'unsafe-eval' source expressions for the 'script-src' and 'style-src' directives. Please use those directives instead, as 'options' has no effect. 3 3 CONSOLE MESSAGE: The 'options' directive has been replaced with 'unsafe-inline' and 'unsafe-eval' source expressions for the 'script-src' and 'style-src' directives. Please use those directives instead, as 'options' has no effect. 4 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.4 CONSOLE MESSAGE: Refused to execute a script because its hash or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 5 5 This test passes if it doesn't alert fail. -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/javascript-url-blocked-by-default-src-star-expected.txt
r259900 r288132 1 1 CONSOLE MESSAGE: Refused to load javascript:alert('FAIL'); because it appears in neither the object-src directive nor the default-src directive of the Content Security Policy. 2 2 CONSOLE MESSAGE: Refused to load javascript:alert('FAIL'); because it appears in neither the object-src directive nor the default-src directive of the Content Security Policy. 3 CONSOLE MESSAGE: Refused to execute a script because its hash , its nonce,or 'unsafe-inline' appears in neither the script-src directive nor the default-src directive of the Content Security Policy.3 CONSOLE MESSAGE: Refused to execute a script because its hash or 'unsafe-inline' appears in neither the script-src directive nor the default-src directive of the Content Security Policy. 4 4 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/javascript-url-blocked-expected.txt
r285214 r288132 2 2 CONSOLE MESSAGE: The 'allow' directive has been replaced with 'default-src'. Please use that directive instead, as 'allow' has no effect. 3 3 CONSOLE MESSAGE: The 'allow' directive has been replaced with 'default-src'. Please use that directive instead, as 'allow' has no effect. 4 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.4 CONSOLE MESSAGE: Refused to execute a script because its hash or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 5 5 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked-expected.txt
r259900 r288132 1 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.1 CONSOLE MESSAGE: Refused to execute a script because its hash or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 2 2 -
trunk/LayoutTests/http/tests/security/contentSecurityPolicy/window-open-javascript-url-with-target-blocked-expected.txt
r259900 r288132 1 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.1 CONSOLE MESSAGE: Refused to execute a script because its hash or 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy. 2 2 -
trunk/LayoutTests/imported/w3c/ChangeLog
r288113 r288132 1 2022-01-18 Patrick Griffis <pgriffis@igalia.com> 2 3 CSP: Improve handling of multiple policies 4 https://bugs.webkit.org/show_bug.cgi?id=235199 5 6 Reviewed by Kate Cheney. 7 8 Add new test expectations with more passes. 9 10 * web-platform-tests/content-security-policy/script-src/script-src-multiple-policies-one-using-hashing-algorithms-expected.txt: 11 * web-platform-tests/content-security-policy/script-src/script-src-strict_dynamic_parser_inserted-expected.txt: 12 * web-platform-tests/content-security-policy/style-src/style-src-error-event-fires-expected.txt: 13 * web-platform-tests/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event-expected.txt: 14 * web-platform-tests/content-security-policy/style-src/style-src-multiple-policies-multiple-hashing-algorithms-expected.txt: Added. 15 1 16 2022-01-17 Sergio Villar Senin <svillar@igalia.com> 2 17 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-multiple-policies-one-using-hashing-algorithms-expected.txt
r246330 r288132 1 layer at (0,0) size 1280x960 2 RenderView at (0,0) size 1280x960 3 layer at (0,0) size 1280x8 4 RenderBlock {HTML} at (0,0) size 1280x8 5 RenderBody {BODY} at (8,8) size 1264x0 1 2 PASS Test that script executes if allowed by proper hash values 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/script-src/script-src-strict_dynamic_parser_inserted-expected.txt
r283192 r288132 1 1 Parser-inserted scripts without a correct nonce are not allowed with `strict-dynamic` in the script-src directive. 2 2 3 4 Harness Error (TIMEOUT), message = null5 3 6 4 PASS Parser-inserted script via `document.write` without a correct nonce is not allowed with `strict-dynamic`. … … 12 10 PASS Parser-inserted deferred async script via `document.write` without a correct nonce is not allowed with `strict-dynamic`. 13 11 PASS Parser-inserted deferred async script via `document.writeln` without a correct nonce is not allowed with `strict-dynamic`. 14 TIMEOUT Script injected via `innerHTML` is not allowed with `strict-dynamic`. Test timed out 15 TIMEOUT Script injected via `insertAdjacentHTML` is not allowed with `strict-dynamic`. Test timed out 12 FAIL Script injected via `innerHTML` is not allowed with `strict-dynamic`. assert_equals: expected "script-src-attr" but got "script-src" 13 FAIL Script injected via `insertAdjacentHTML` is not allowed with `strict-dynamic`. assert_equals: expected "script-src-attr" but got "script-src" 16 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-error-event-fires-expected.txt
r267651 r288132 5 5 Harness Error (TIMEOUT), message = null 6 6 7 NOTRUNTest error event fires on stylesheet link7 PASS Test error event fires on stylesheet link 8 8 NOTRUN Test error event fires on inline style 9 9 Lorem ipsum -
trunk/LayoutTests/imported/w3c/web-platform-tests/content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event-expected.txt
r267651 r288132 3 3 Harness Error (TIMEOUT), message = null 4 4 5 FAIL Should fire a securitypolicyviolation event assert_equals: expected "style-src 'nonce-nonceynonce'" but got "style-src-elem" 5 PASS Should fire a securitypolicyviolation event 6 6 NOTRUN Test that paragraph remains unmodified and error events received. 7 7 Lorem ipsum -
trunk/LayoutTests/platform/glib/TestExpectations
r288096 r288132 1440 1440 1441 1441 # Failing since deferred async loading enabled until document is loaded enabled. 1442 webkit.org/b/208104 imported/w3c/web-platform-tests/content-security-policy/script-src/scripthash-changed-2.html [ Failure ]1443 webkit.org/b/208104 imported/w3c/web-platform-tests/content-security-policy/script-src/scriptnonce-changed-2.html [ Failure ]1444 1442 webkit.org/b/208104 imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/execution-timing/085.html [ Failure Pass ] 1445 1443 -
trunk/LayoutTests/platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only-expected.txt
r275917 r288132 3 3 frame "<!--frame1-->" - didCommitLoadForFrame 4 4 CONSOLE MESSAGE: [Report Only] Blocked mixed content http://127.0.0.1:8000/security/mixedContent/resources/style.css because 'block-all-mixed-content' appears in the Content Security Policy. 5 CONSOLE MESSAGE: [blocked] The page at https://127.0.0.1:8443/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.p hpwas not allowed to run insecure content from http://127.0.0.1:8000/security/mixedContent/resources/style.css.5 CONSOLE MESSAGE: [blocked] The page at https://127.0.0.1:8443/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.py was not allowed to run insecure content from http://127.0.0.1:8000/security/mixedContent/resources/style.css. 6 6 7 frame "<!--frame1-->" - willPerformClientRedirectToURL: https://127.0.0.1:8443/security/contentSecurityPolicy/resources/echo-report.py?test=/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.p hp7 frame "<!--frame1-->" - willPerformClientRedirectToURL: https://127.0.0.1:8443/security/contentSecurityPolicy/resources/echo-report.py?test=/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.py 8 8 frame "<!--frame1-->" - didFinishDocumentLoadForFrame 9 9 main frame - didHandleOnloadEventsForFrame 10 frame "<!--frame1-->" - didFinishLoadForFrame11 10 frame "<!--frame1-->" - didStartProvisionalLoadForFrame 12 11 frame "<!--frame1-->" - didCancelClientRedirectForFrame … … 26 25 CONTENT_TYPE: application/csp-report 27 26 HTTP_HOST: 127.0.0.1:8443 28 HTTP_REFERER: https://127.0.0.1:8443/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.p hp27 HTTP_REFERER: https://127.0.0.1:8443/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.py 29 28 REQUEST_METHOD: POST 30 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.p hp?test=/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.php29 REQUEST_URI: /security/contentSecurityPolicy/resources/save-report.py?test=/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.py 31 30 === POST DATA === 32 {"csp-report":{"document-uri":"https://127.0.0.1:8443/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.p hp","referrer":"http://127.0.0.1:8000/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only.html","violated-directive":"block-all-mixed-content","effective-directive":"block-all-mixed-content","original-policy":"block-all-mixed-content; report-uri ../../resources/save-report.php?test=/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.php","blocked-uri":"http://127.0.0.1:8000","status-code":0}}31 {"csp-report":{"document-uri":"https://127.0.0.1:8443/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.py","referrer":"http://127.0.0.1:8000/","violated-directive":"block-all-mixed-content","effective-directive":"block-all-mixed-content","original-policy":"block-all-mixed-content; report-uri ../../resources/save-report.py?test=/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.py","blocked-uri":"http://127.0.0.1:8000","status-code":0}} -
trunk/Source/WebCore/ChangeLog
r288127 r288132 1 2022-01-18 Patrick Griffis <pgriffis@igalia.com> 2 3 CSP: Improve handling of multiple policies 4 https://bugs.webkit.org/show_bug.cgi?id=235199 5 6 Reviewed by Kate Cheney. 7 8 This fixes many issues with multiple CSP policies. 9 10 To quote the spec for script-src: 11 12 > Their behavior will be blocked unless every policy allows inline script, either implicitly by not 13 specifying a script-src (or default-src) directive, or explicitly, by specifying "unsafe-inline", 14 a nonce-source or a hash-source that matches the inline block. 15 16 The previous structure was many distinct calls to check if there was a nonce in any policy, then if there 17 was a hash in any policy, etc, rather than actually checking the policies as a whole to know if they 18 allow or block a behavior. This lead to various issues where polices were not properly respected and where 19 reports were inaccurate. 20 21 The allScriptPoliciesAllow() function did try to consider all policies but was not very flexible and had buggy 22 behavior like for each policy it would call findHashOfContentInPolicies() meaning hashes from other policies 23 incorrectly applied to the current policy, plus general inefficiency of hashing the same content many 24 times over. 25 26 The new behavior relies more on passing all required information in a single function call to verify all 27 policies in a single pass. 28 29 * bindings/js/CachedScriptFetcher.cpp: 30 (WebCore::CachedScriptFetcher::requestScriptWithCache const): 31 * dom/InlineStyleSheetOwner.cpp: 32 (WebCore::InlineStyleSheetOwner::createSheet): 33 * dom/ScriptElement.cpp: 34 (WebCore::ScriptElement::requestModuleScript): 35 (WebCore::ScriptElement::executeClassicScript): 36 * dom/StyledElement.cpp: 37 (WebCore::StyledElement::styleAttributeChanged): 38 * html/HTMLLinkElement.cpp: 39 (WebCore::HTMLLinkElement::process): 40 * loader/DocumentThreadableLoader.cpp: 41 (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): 42 * loader/ResourceLoaderOptions.h: 43 * loader/cache/CachedResourceLoader.cpp: 44 (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const): 45 * page/csp/ContentSecurityPolicy.cpp: 46 (WebCore::parseSubResourceIntegrityIntoDigests): 47 (WebCore::generateHashesForContent): 48 (WebCore::ContentSecurityPolicy::allowJavaScriptURLs const): 49 (WebCore::ContentSecurityPolicy::allowInlineEventHandlers const): 50 (WebCore::ContentSecurityPolicy::allowNonParserInsertedScripts const): 51 (WebCore::ContentSecurityPolicy::allowInlineScript const): 52 (WebCore::ContentSecurityPolicy::allowInlineStyle const): 53 (WebCore::ContentSecurityPolicy::allowScriptFromSource const): 54 (WebCore::ContentSecurityPolicy::allowStyleFromSource const): 55 (WebCore::ContentSecurityPolicy::allScriptPoliciesAllow const): Deleted. 56 (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies const): Deleted. 57 (WebCore::ContentSecurityPolicy::checkHashAndReportViolation const): Deleted. 58 * page/csp/ContentSecurityPolicy.h: 59 * page/csp/ContentSecurityPolicyDirectiveList.cpp: 60 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement const): 61 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForInlineJavascriptURL const): 62 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForInlineEventHandlers const): 63 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForNonParserInsertedScripts const): 64 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleElement const): 65 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleAttribute const): 66 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScript const): 67 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle const): 68 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript const): Deleted. 69 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashStyle const): Deleted. 70 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForParserInsertedScript const): Deleted. 71 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptAttribute const): Deleted. 72 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash const): Deleted. 73 (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash const): Deleted. 74 * page/csp/ContentSecurityPolicyDirectiveList.h: 75 1 76 2022-01-18 Simon Fraser <simon.fraser@apple.com> 2 77 -
trunk/Source/WebCore/bindings/js/CachedScriptFetcher.cpp
r278253 r288132 59 59 options.integrity = WTFMove(integrity); 60 60 options.referrerPolicy = m_referrerPolicy; 61 options.nonce = m_nonce; 61 62 62 63 auto request = createPotentialAccessControlRequest(sourceURL, WTFMove(options), document, crossOriginMode); -
trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp
r286599 r288132 171 171 ASSERT(document.contentSecurityPolicy()); 172 172 const ContentSecurityPolicy& contentSecurityPolicy = *document.contentSecurityPolicy(); 173 bool hasKnownNonce = contentSecurityPolicy.allowStyleWithNonce(element.nonce(), element.isInUserAgentShadowTree()); 174 if (!contentSecurityPolicy.allowInlineStyle(document.url().string(), m_startTextPosition.m_line, text, CheckUnsafeHashes::No, element, hasKnownNonce)) 173 if (!contentSecurityPolicy.allowInlineStyle(document.url().string(), m_startTextPosition.m_line, text, CheckUnsafeHashes::No, element, element.nonce(), element.isInUserAgentShadowTree())) 175 174 return; 176 175 -
trunk/Source/WebCore/dom/ScriptElement.cpp
r288004 r288132 384 384 return false; 385 385 386 bool hasKnownNonce = contentSecurityPolicy.allowScriptWithNonce(nonce, m_element.isInUserAgentShadowTree()); 387 if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source(), m_element, hasKnownNonce)) 386 if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source(), m_element, nonce, m_element.isInUserAgentShadowTree())) 388 387 return false; 389 388 … … 408 407 return; 409 408 410 bool hasKnownNonce = contentSecurityPolicy.allowScriptWithNonce(m_element.nonce(), m_element.isInUserAgentShadowTree()); 411 if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source(), m_element, hasKnownNonce)) 409 if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source(), m_element, m_element.nonce(), m_element.isInUserAgentShadowTree())) 412 410 return; 413 411 } -
trunk/Source/WebCore/dom/StyledElement.cpp
r286136 r288132 207 207 startLineNumber = document().scriptableDocumentParser()->textPosition().m_line; 208 208 209 if (reason == ModifiedByCloning || document().contentSecurityPolicy()->allowInlineStyle(document().url().string(), startLineNumber, newStyleString.string(), CheckUnsafeHashes::Yes, *this, isInUserAgentShadowTree()))209 if (reason == ModifiedByCloning || document().contentSecurityPolicy()->allowInlineStyle(document().url().string(), startLineNumber, newStyleString.string(), CheckUnsafeHashes::Yes, *this, nonce(), isInUserAgentShadowTree())) 210 210 setInlineStyleFromString(newStyleString); 211 211 -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r286772 r288132 322 322 323 323 ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions(); 324 options.nonce = attributeWithoutSynchronization(HTMLNames::nonceAttr); 324 325 options.sameOriginDataURLFlag = SameOriginDataURLFlag::Set; 325 if (document().contentSecurityPolicy()->allowStyleWithNonce( attributeWithoutSynchronization(HTMLNames::nonceAttr)))326 if (document().contentSecurityPolicy()->allowStyleWithNonce(options.nonce)) 326 327 options.contentSecurityPolicyImposition = ContentSecurityPolicyImposition::SkipPolicyCheck; 327 328 options.integrity = m_integrityMetadataForPendingSheetRequest; -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r288088 r288132 687 687 return contentSecurityPolicy().allowConnectToSource(url, redirectResponseReceived, preRedirectURL); 688 688 case ContentSecurityPolicyEnforcement::EnforceScriptSrcDirective: 689 return contentSecurityPolicy().allowScriptFromSource(url, redirectResponseReceived, preRedirectURL, m_options.integrity );689 return contentSecurityPolicy().allowScriptFromSource(url, redirectResponseReceived, preRedirectURL, m_options.integrity, m_options.nonce); 690 690 } 691 691 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/loader/ResourceLoaderOptions.h
r286361 r288132 207 207 uint8_t maxRedirectCount { 20 }; 208 208 FetchIdentifier navigationPreloadIdentifier; 209 String nonce; 209 210 210 211 SendCallbackPolicy sendLoadCallbacks : bitWidthOfSendCallbackPolicy; -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r287731 r288132 502 502 #endif 503 503 case CachedResource::Type::Script: 504 if (!m_document->contentSecurityPolicy()->allowScriptFromSource(url, redirectResponseReceived, preRedirectURL, options.integrity ))504 if (!m_document->contentSecurityPolicy()->allowScriptFromSource(url, redirectResponseReceived, preRedirectURL, options.integrity, options.nonce)) 505 505 return false; 506 506 break; 507 507 case CachedResource::Type::CSSStyleSheet: 508 if (!m_document->contentSecurityPolicy()->allowStyleFromSource(url, redirectResponseReceived, preRedirectURL ))508 if (!m_document->contentSecurityPolicy()->allowStyleFromSource(url, redirectResponseReceived, preRedirectURL, options.nonce)) 509 509 return false; 510 510 break; -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
r287783 r288132 335 335 } 336 336 337 bool ContentSecurityPolicy::allScriptPoliciesAllow(ViolatedDirectiveCallback&& callback, const URL& url, const String& nonce, const StringView& scriptContent, ParserInserted parserInserted) const 338 { 339 bool isAllowed = true; 340 for (auto& policy : m_policies) { 341 auto violatedDirectiveForNonParserInsertedScript = policy.get()->violatedDirectiveForParserInsertedScript(parserInserted); 342 auto violatedDirectiveForScriptNonce = policy.get()->violatedDirectiveForScriptNonce(nonce); 343 auto violatedDirectiveForScriptSrc = policy.get()->violatedDirectiveForScript(url, false, { }); 344 auto [foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies] = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash, scriptContent, m_hashAlgorithmsForInlineScripts); 345 346 if (violatedDirectiveForNonParserInsertedScript && violatedDirectiveForScriptNonce && violatedDirectiveForScriptSrc && !foundHashInEnforcedPolicies) { 347 if (!violatedDirectiveForNonParserInsertedScript->directiveList().isReportOnly() 348 || !violatedDirectiveForScriptNonce->directiveList().isReportOnly() 349 || !violatedDirectiveForScriptSrc->directiveList().isReportOnly() 350 || foundHashInReportOnlyPolicies) 351 isAllowed = false; 352 353 callback(*violatedDirectiveForScriptSrc); 337 static Vector<ResourceCryptographicDigest> parseSubResourceIntegrityIntoDigests(const String& subResourceIntegrity) 338 { 339 auto encodedDigests = parseIntegrityMetadata(subResourceIntegrity); 340 Vector<ResourceCryptographicDigest> decodedDigests; 341 342 if (!encodedDigests.has_value()) 343 return { }; 344 345 for (const auto& encodedDigest : encodedDigests.value()) { 346 auto decodedDigest = decodeEncodedResourceCryptographicDigest(encodedDigest); 347 if (decodedDigest.has_value()) 348 decodedDigests.append(decodedDigest.value()); 354 349 } 355 } 356 return isAllowed; 357 } 358 359 template<typename Predicate> 360 ContentSecurityPolicy::HashInEnforcedAndReportOnlyPoliciesPair ContentSecurityPolicy::findHashOfContentInPolicies(const Predicate& predicate, StringView content, OptionSet<ContentSecurityPolicyHashAlgorithm> algorithms) const 361 { 362 if (algorithms.isEmpty() || content.isEmpty()) 363 return { false, false }; 364 350 351 return decodedDigests; 352 } 353 354 static Vector<ContentSecurityPolicyHash> generateHashesForContent(const StringView content, OptionSet<ContentSecurityPolicyHashAlgorithm> algorithms) 355 { 365 356 CString utf8Content = content.utf8(StrictConversionReplacingUnpairedSurrogatesWithFFFD); 366 bool foundHashInEnforcedPolicies = false;367 bool foundHashInReportOnlyPolicies = false;368 357 Vector<ContentSecurityPolicyHash> hashes; 369 358 for (auto algorithm : algorithms) { … … 371 360 hashes.append(hash); 372 361 } 373 if (!foundHashInEnforcedPolicies && allPoliciesWithDispositionAllow(ContentSecurityPolicy::Disposition::Enforce, predicate, hashes)) 374 foundHashInEnforcedPolicies = true; 375 if (!foundHashInReportOnlyPolicies && allPoliciesWithDispositionAllow(ContentSecurityPolicy::Disposition::ReportOnly, predicate, hashes)) 376 foundHashInReportOnlyPolicies = true; 377 378 return { foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies }; 379 } 380 381 template<typename ViolatedDirective, typename HashSearchPolicy> 382 bool ContentSecurityPolicy::checkHashAndReportViolation(const String& source, const ViolatedDirective& violatedDirective, const HashSearchPolicy& searchPolicy, OptionSet<ContentSecurityPolicyHashAlgorithm> hashAlgorithms, ContentSecurityPolicy::ViolatedDirectiveCallback&& callback) const 383 { 384 auto [foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies] = findHashOfContentInPolicies(searchPolicy, source, hashAlgorithms); 385 if (foundHashInEnforcedPolicies && foundHashInReportOnlyPolicies) 386 return true; 387 388 if (!foundHashInReportOnlyPolicies) 389 allPoliciesWithDispositionAllow(ContentSecurityPolicy::Disposition::ReportOnly, std::forward<ViolatedDirectiveCallback>(callback), violatedDirective); 390 391 return foundHashInEnforcedPolicies || allPoliciesWithDispositionAllow(ContentSecurityPolicy::Disposition::Enforce, WTFMove(callback), violatedDirective); 362 363 return hashes; 392 364 } 393 365 … … 398 370 bool didNotifyInspector = false; 399 371 auto handleViolatedDirective = [&] (const ContentSecurityPolicyDirective& violatedDirective) { 400 String consoleMessage = consoleMessageForViolation(ContentSecurityPolicyDirectiveNames::scriptSrc, violatedDirective, URL(), "Refused to execute a script", "its hash , its nonce,or 'unsafe-inline'");372 String consoleMessage = consoleMessageForViolation(ContentSecurityPolicyDirectiveNames::scriptSrc, violatedDirective, URL(), "Refused to execute a script", "its hash or 'unsafe-inline'"); 401 373 // FIXME (rdar://83332874) implement scriptSrcElem properly. 402 374 reportViolation(ContentSecurityPolicyDirectiveNames::scriptSrcElem, violatedDirective, "inline"_s, consoleMessage, contextURL, source, TextPosition(contextLine, OrdinalNumber())); … … 407 379 }; 408 380 409 return checkHashAndReportViolation(source, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript, m_hashAlgorithmsForInlineScripts, handleViolatedDirective); 381 auto contentHashes = generateHashesForContent(source, m_hashAlgorithmsForInlineScripts); 382 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForInlineJavascriptURL, contentHashes); 410 383 } 411 384 … … 424 397 }; 425 398 426 return checkHashAndReportViolation(source, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptAttribute, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript, m_hashAlgorithmsForInlineScripts, handleViolatedDirective); 399 auto contentHashes = generateHashesForContent(source, m_hashAlgorithmsForInlineScripts); 400 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForInlineEventHandlers, contentHashes); 427 401 } 428 402 … … 472 446 }; 473 447 474 return allScriptPoliciesAllow(handleViolatedDirective, sourceURL, nonce, scriptContent, parserInserted); 475 } 476 477 bool ContentSecurityPolicy::allowInlineScript(const String& contextURL, const OrdinalNumber& contextLine, StringView scriptContent, Element& element, bool overrideContentSecurityPolicy) const 448 auto contentHashes = generateHashesForContent(scriptContent, m_hashAlgorithmsForInlineScripts); 449 String strippedNonce = stripLeadingAndTrailingHTMLSpaces(nonce); 450 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForNonParserInsertedScripts, strippedNonce, contentHashes, sourceURL, parserInserted); 451 } 452 453 bool ContentSecurityPolicy::allowInlineScript(const String& contextURL, const OrdinalNumber& contextLine, StringView scriptContent, Element& element, const String& nonce, bool overrideContentSecurityPolicy) const 478 454 { 479 455 if (overrideContentSecurityPolicy || shouldPerformEarlyCSPCheck()) … … 488 464 } 489 465 }; 490 // FIXME: We should not report that the inline script violated a policy when its hash matched a source 491 // expression in the policy and the page has more than one policy. See <https://bugs.webkit.org/show_bug.cgi?id=159832>. 492 return checkHashAndReportViolation(scriptContent.toString(), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement, &ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash, m_hashAlgorithmsForInlineScripts, handleViolatedDirective); 493 } 494 495 bool ContentSecurityPolicy::allowInlineStyle(const String& contextURL, const OrdinalNumber& contextLine, StringView styleContent, CheckUnsafeHashes shouldCheckUnsafeHashes, Element& element, bool overrideContentSecurityPolicy) const 466 467 auto contentHashes = generateHashesForContent(scriptContent, m_hashAlgorithmsForInlineScripts); 468 String strippedNonce = stripLeadingAndTrailingHTMLSpaces(nonce); 469 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement, strippedNonce, contentHashes); 470 } 471 472 bool ContentSecurityPolicy::allowInlineStyle(const String& contextURL, const OrdinalNumber& contextLine, StringView styleContent, CheckUnsafeHashes shouldCheckUnsafeHashes, Element& element, const String& nonce, bool overrideContentSecurityPolicy) const 496 473 { 497 474 if (overrideContentSecurityPolicy) … … 505 482 }; 506 483 484 auto contentHashes = generateHashesForContent(styleContent, m_hashAlgorithmsForInlineStylesheets); 485 String strippedNonce = stripLeadingAndTrailingHTMLSpaces(nonce); 486 507 487 if (shouldCheckUnsafeHashes == CheckUnsafeHashes::Yes) 508 return checkHashAndReportViolation(styleContent.toString(), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleAttribute, &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashStyle, m_hashAlgorithmsForInlineStylesheets, handleViolatedDirective); 509 510 // FIXME: We should not report that the inline stylesheet violated a policy when its hash matched a source 511 // expression in the policy and the page has more than one policy. See <https://bugs.webkit.org/show_bug.cgi?id=159832>. 512 return checkHashAndReportViolation(styleContent.toString(), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleElement, &ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash, m_hashAlgorithmsForInlineStylesheets, handleViolatedDirective); 488 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleAttribute, strippedNonce, contentHashes); 489 490 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleElement, strippedNonce, contentHashes); 513 491 } 514 492 … … 635 613 } 636 614 637 static Vector<ResourceCryptographicDigest> parseSubResourceIntegrityIntoDigests(const String& subResourceIntegrity) 638 { 639 auto encodedDigests = parseIntegrityMetadata(subResourceIntegrity); 640 Vector<ResourceCryptographicDigest> decodedDigests; 641 642 if (!encodedDigests.has_value()) 643 return { }; 644 645 for (const auto& encodedDigest : encodedDigests.value()) { 646 auto decodedDigest = decodeEncodedResourceCryptographicDigest(encodedDigest); 647 if (decodedDigest.has_value()) 648 decodedDigests.append(decodedDigest.value()); 649 } 650 651 return decodedDigests; 652 } 653 654 bool ContentSecurityPolicy::allowScriptFromSource(const URL& url, RedirectResponseReceived redirectResponseReceived, const URL& preRedirectURL, const String& subResourceIntegrity) const 615 bool ContentSecurityPolicy::allowScriptFromSource(const URL& url, RedirectResponseReceived redirectResponseReceived, const URL& preRedirectURL, const String& subResourceIntegrity, const String& nonce) const 655 616 { 656 617 if (shouldPerformEarlyCSPCheck()) … … 668 629 669 630 auto subResourceIntegrityDigests = parseSubResourceIntegrityIntoDigests(subResourceIntegrity); 670 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForScript, url, redirectResponseReceived == RedirectResponseReceived::Yes, subResourceIntegrityDigests); 631 String strippedNonce = stripLeadingAndTrailingHTMLSpaces(nonce); 632 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForScript, url, redirectResponseReceived == RedirectResponseReceived::Yes, subResourceIntegrityDigests, strippedNonce); 671 633 } 672 634 … … 676 638 } 677 639 678 bool ContentSecurityPolicy::allowStyleFromSource(const URL& url, RedirectResponseReceived redirectResponseReceived, const URL& preRedirectURL) const 679 { 680 return allowResourceFromSource(url, redirectResponseReceived, ContentSecurityPolicyDirectiveNames::styleSrc, &ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle, preRedirectURL); 640 bool ContentSecurityPolicy::allowStyleFromSource(const URL& url, RedirectResponseReceived redirectResponseReceived, const URL& preRedirectURL, const String& nonce) const 641 { 642 if (LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy(url.protocol().toStringWithoutCopying())) 643 return true; 644 String sourceURL; 645 const auto& blockedURL = !preRedirectURL.isNull() ? preRedirectURL : url; 646 TextPosition sourcePosition(OrdinalNumber::beforeFirst(), OrdinalNumber()); 647 auto handleViolatedDirective = [&] (const ContentSecurityPolicyDirective& violatedDirective) { 648 String consoleMessage = consoleMessageForViolation(ContentSecurityPolicyDirectiveNames::styleSrc, violatedDirective, blockedURL, "Refused to load"); 649 reportViolation(ContentSecurityPolicyDirectiveNames::styleSrc, violatedDirective, blockedURL.string(), consoleMessage, sourceURL, StringView(), sourcePosition); 650 }; 651 652 String strippedNonce = stripLeadingAndTrailingHTMLSpaces(nonce); 653 return allPoliciesAllow(WTFMove(handleViolatedDirective), &ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle, url, redirectResponseReceived == RedirectResponseReceived::Yes, strippedNonce); 681 654 } 682 655 -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h
r287783 r288132 101 101 bool allowJavaScriptURLs(const String& contextURL, const OrdinalNumber& contextLine, const String& code, bool overrideContentSecurityPolicy = false) const; 102 102 bool allowInlineEventHandlers(const String& contextURL, const OrdinalNumber& contextLine, const String& code, Element*, bool overrideContentSecurityPolicy = false) const; 103 bool allowInlineScript(const String& contextURL, const OrdinalNumber& contextLine, StringView scriptContent, Element&, bool overrideContentSecurityPolicy = false) const;104 bool allowNonParserInsertedScripts(const URL& sourceURL, const URL& contextURL, const OrdinalNumber&, const String& , const StringView&, ParserInserted) const;105 bool allowInlineStyle(const String& contextURL, const OrdinalNumber& contextLine, StringView styleContent, CheckUnsafeHashes, Element&, bool overrideContentSecurityPolicy = false) const;103 bool allowInlineScript(const String& contextURL, const OrdinalNumber& contextLine, StringView scriptContent, Element&, const String& nonce, bool overrideContentSecurityPolicy = false) const; 104 bool allowNonParserInsertedScripts(const URL& sourceURL, const URL& contextURL, const OrdinalNumber&, const String& nonce, const StringView&, ParserInserted) const; 105 bool allowInlineStyle(const String& contextURL, const OrdinalNumber& contextLine, StringView styleContent, CheckUnsafeHashes, Element&, const String&, bool overrideContentSecurityPolicy = false) const; 106 106 107 107 bool allowEval(JSC::JSGlobalObject*, LogToConsole, StringView codeContent, bool overrideContentSecurityPolicy = false) const; … … 114 114 115 115 enum class RedirectResponseReceived { No, Yes }; 116 WEBCORE_EXPORT bool allowScriptFromSource(const URL&, RedirectResponseReceived = RedirectResponseReceived::No, const URL& preRedirectURL = URL(), const String& = nullString() ) const;116 WEBCORE_EXPORT bool allowScriptFromSource(const URL&, RedirectResponseReceived = RedirectResponseReceived::No, const URL& preRedirectURL = URL(), const String& = nullString(), const String& nonce = nullString()) const; 117 117 bool allowImageFromSource(const URL&, RedirectResponseReceived = RedirectResponseReceived::No, const URL& preRedirectURL = URL()) const; 118 bool allowStyleFromSource(const URL&, RedirectResponseReceived = RedirectResponseReceived::No, const URL& preRedirectURL = URL() ) const;118 bool allowStyleFromSource(const URL&, RedirectResponseReceived = RedirectResponseReceived::No, const URL& preRedirectURL = URL(), const String& nonce = nullString()) const; 119 119 bool allowFontFromSource(const URL&, RedirectResponseReceived = RedirectResponseReceived::No, const URL& preRedirectURL = URL()) const; 120 120 #if ENABLE(APPLICATION_MANIFEST) … … 215 215 template<typename Predicate, typename... Args> 216 216 bool allPoliciesAllow(ViolatedDirectiveCallback&&, Predicate&&, Args&&...) const WARN_UNUSED_RETURN; 217 bool allScriptPoliciesAllow(ViolatedDirectiveCallback&&, const URL&, const String&, const StringView&, ParserInserted) const;218 217 bool shouldPerformEarlyCSPCheck() const; 219 218 220 219 using ResourcePredicate = const ContentSecurityPolicyDirective *(ContentSecurityPolicyDirectiveList::*)(const URL &, bool) const; 221 220 bool allowResourceFromSource(const URL&, RedirectResponseReceived, const char*, ResourcePredicate, const URL& preRedirectURL = URL()) const; 222 223 using HashInEnforcedAndReportOnlyPoliciesPair = std::pair<bool, bool>;224 template<typename Predicate> HashInEnforcedAndReportOnlyPoliciesPair findHashOfContentInPolicies(const Predicate&, StringView content, OptionSet<ContentSecurityPolicyHashAlgorithm>) const WARN_UNUSED_RETURN;225 221 226 222 void reportViolation(const String& effectiveViolatedDirective, const ContentSecurityPolicyDirective& violatedDirective, const String& blockedURL, const String& consoleMessage, JSC::JSGlobalObject*, StringView sourceContent) const; … … 229 225 void reportViolation(const String& effectiveViolatedDirective, const String& violatedDirective, const ContentSecurityPolicyDirectiveList& violatedDirectiveList, const String& blockedURL, const String& consoleMessage, const String& sourceURL, const StringView& sourceContent, const TextPosition& sourcePosition, JSC::JSGlobalObject*, const URL& preRedirectURL = URL(), Element* = nullptr) const; 230 226 void reportBlockedScriptExecutionToInspector(const String& directiveText) const; 231 232 template<typename ViolatedDirective, typename HashSearchPolicy> bool checkHashAndReportViolation(const String&, const ViolatedDirective&, const HashSearchPolicy&, OptionSet<ContentSecurityPolicyHashAlgorithm>, ContentSecurityPolicy::ViolatedDirectiveCallback&&) const;233 227 234 228 // We can never have both a script execution context and a ContentSecurityPolicyClient. -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp
r287011 r288132 191 191 } 192 192 193 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashScript(const Vector<ContentSecurityPolicyHash>& hashes) const 194 { 195 auto* operativeDirective = this->operativeDirective(m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 196 if (checkUnsafeHashes(operativeDirective, hashes)) 197 return nullptr; 198 return operativeDirective; 199 } 200 201 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeHashStyle(const Vector<ContentSecurityPolicyHash>& hashes) const 202 { 203 auto* operativeDirective = this->operativeDirective(m_styleSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 204 if (checkUnsafeHashes(operativeDirective, hashes)) 205 return nullptr; 206 return operativeDirective; 207 } 208 209 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForParserInsertedScript(ParserInserted parserInserted) const 193 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptElement(const String& nonce, const Vector<ContentSecurityPolicyHash>& hashes) const 194 { 195 auto* operativeDirective = this->operativeDirectiveScript(m_scriptSrcElem.get(), ContentSecurityPolicyDirectiveNames::scriptSrcElem); 196 if (checkHashes(operativeDirective, hashes) 197 || checkNonce(operativeDirective, nonce) 198 || checkInline(operativeDirective)) 199 return nullptr; 200 return operativeDirective; 201 } 202 203 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForInlineJavascriptURL(const Vector<ContentSecurityPolicyHash>& hashes) const 204 { 205 auto* operativeDirective = this->operativeDirectiveScript(m_scriptSrcElem.get(), ContentSecurityPolicyDirectiveNames::scriptSrcElem); 206 if (checkUnsafeHashes(operativeDirective, hashes) 207 || checkInline(operativeDirective)) 208 return nullptr; 209 return operativeDirective; 210 } 211 212 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForInlineEventHandlers(const Vector<ContentSecurityPolicyHash>& hashes) const 213 { 214 auto* operativeDirective = this->operativeDirectiveScript(m_scriptSrcAttr.get(), ContentSecurityPolicyDirectiveNames::scriptSrcAttr); 215 if (checkUnsafeHashes(operativeDirective, hashes) 216 || checkInline(operativeDirective)) 217 return nullptr; 218 return operativeDirective; 219 } 220 221 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForNonParserInsertedScripts(const String& nonce, const Vector<ContentSecurityPolicyHash>& hashes, const URL& url, ParserInserted parserInserted) const 210 222 { 211 223 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); 221 if (checkInline(operativeDirective)) 222 return nullptr; 223 return operativeDirective; 224 } 225 226 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineScriptAttribute() const 227 { 228 auto* operativeDirective = this->operativeDirectiveScript(m_scriptSrcAttr.get(), ContentSecurityPolicyDirectiveNames::scriptSrcAttr); 229 if (checkInline(operativeDirective)) 230 return nullptr; 231 return operativeDirective; 232 } 233 234 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleElement() const 224 if (checkHashes(operativeDirective, hashes) 225 || checkNonParserInsertedScripts(operativeDirective, parserInserted) 226 || checkNonce(operativeDirective, nonce) 227 || checkSource(operativeDirective, url)) 228 return nullptr; 229 return operativeDirective; 230 } 231 232 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleElement(const String& nonce, const Vector<ContentSecurityPolicyHash>& hashes) const 235 233 { 236 234 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 235 if (checkHashes(operativeDirective, hashes) 236 || checkNonce(operativeDirective, nonce) 237 || checkInline(operativeDirective)) 238 return nullptr; 239 return operativeDirective; 240 } 241 242 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForUnsafeInlineStyleAttribute(const String& nonce, const Vector<ContentSecurityPolicyHash>& hashes) const 243 243 { 244 244 auto* operativeDirective = this->operativeDirectiveStyle(m_styleSrcAttr.get(), ContentSecurityPolicyDirectiveNames::styleSrcAttr); 245 if (checkInline(operativeDirective)) 246 return nullptr; 247 return operativeDirective; 248 } 249 250 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash(const Vector<ContentSecurityPolicyHash>& hashes) const 251 { 252 auto* operativeDirective = this->operativeDirective(m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrc); 253 if (checkHashes(operativeDirective, hashes)) 254 return nullptr; 255 return operativeDirective; 256 } 257 258 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash(const Vector<ContentSecurityPolicyHash>& hashes) const 259 { 260 auto* operativeDirective = this->operativeDirective(m_styleSrc.get(), ContentSecurityPolicyDirectiveNames::styleSrc); 261 if (checkHashes(operativeDirective, hashes)) 245 if (checkUnsafeHashes(operativeDirective, hashes) 246 || checkNonce(operativeDirective, nonce) 247 || checkInline(operativeDirective)) 262 248 return nullptr; 263 249 return operativeDirective; … … 388 374 } 389 375 390 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForScript(const URL& url, bool didReceiveRedirectResponse, const Vector<ResourceCryptographicDigest>& subResourceIntegrityDigests ) const376 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForScript(const URL& url, bool didReceiveRedirectResponse, const Vector<ResourceCryptographicDigest>& subResourceIntegrityDigests, const String& nonce) const 391 377 { 392 378 auto* operativeDirective = this->operativeDirective(m_scriptSrc.get(), ContentSecurityPolicyDirectiveNames::scriptSrcElem); 393 379 394 if (!operativeDirective || operativeDirective->containsAllHashes(subResourceIntegrityDigests)) 395 return nullptr; 396 397 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 398 return nullptr; 399 return operativeDirective; 400 } 401 402 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle(const URL& url, bool didReceiveRedirectResponse) const 380 if (!operativeDirective 381 || operativeDirective->containsAllHashes(subResourceIntegrityDigests) 382 || checkNonce(operativeDirective, nonce) 383 || checkSource(operativeDirective, url, didReceiveRedirectResponse)) 384 return nullptr; 385 386 return operativeDirective; 387 } 388 389 const ContentSecurityPolicyDirective* ContentSecurityPolicyDirectiveList::violatedDirectiveForStyle(const URL& url, bool didReceiveRedirectResponse, const String& nonce) const 403 390 { 404 391 auto* operativeDirective = this->operativeDirective(m_styleSrc.get(), ContentSecurityPolicyDirectiveNames::styleSrcElem); 405 if (checkSource(operativeDirective, url, didReceiveRedirectResponse)) 392 if (checkNonce(operativeDirective, nonce) 393 || checkSource(operativeDirective, url, didReceiveRedirectResponse)) 406 394 return nullptr; 407 395 return operativeDirective; -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.h
r286853 r288132 47 47 48 48 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeEval() const; 49 const ContentSecurityPolicyDirective* violatedDirectiveForParserInsertedScript(ParserInserted) const; 50 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineScriptElement() const; 51 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineScriptAttribute() const; 52 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineStyleElement() const; 53 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineStyleAttribute() const; 54 55 const ContentSecurityPolicyDirective* violatedDirectiveForScriptHash(const Vector<ContentSecurityPolicyHash>&) const; 56 const ContentSecurityPolicyDirective* violatedDirectiveForStyleHash(const Vector<ContentSecurityPolicyHash>&) const; 57 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeHashScript(const Vector<ContentSecurityPolicyHash>&) const; 58 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeHashStyle(const Vector<ContentSecurityPolicyHash>&) const; 49 const ContentSecurityPolicyDirective* violatedDirectiveForInlineJavascriptURL(const Vector<ContentSecurityPolicyHash>&) const; 50 const ContentSecurityPolicyDirective* violatedDirectiveForInlineEventHandlers(const Vector<ContentSecurityPolicyHash>&) const; 51 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineScriptElement(const String&, const Vector<ContentSecurityPolicyHash>&) const; 52 const ContentSecurityPolicyDirective* violatedDirectiveForNonParserInsertedScripts(const String&, const Vector<ContentSecurityPolicyHash>&, const URL&, ParserInserted) const; 53 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineStyleElement(const String&, const Vector<ContentSecurityPolicyHash>&) const; 54 const ContentSecurityPolicyDirective* violatedDirectiveForUnsafeInlineStyleAttribute(const String&, const Vector<ContentSecurityPolicyHash>&) const; 59 55 60 56 const ContentSecurityPolicyDirective* violatedDirectiveForScriptNonce(const String&) const; … … 76 72 const ContentSecurityPolicyDirective* violatedDirectiveForObjectSource(const URL&, bool didReceiveRedirectResponse, ContentSecurityPolicySourceListDirective::ShouldAllowEmptyURLIfSourceListIsNotNone) const; 77 73 const ContentSecurityPolicyDirective* violatedDirectiveForPluginType(const String& type, const String& typeAttribute) const; 78 const ContentSecurityPolicyDirective* violatedDirectiveForScript(const URL&, bool didReceiveRedirectResponse, const Vector<ResourceCryptographicDigest>& ) const;79 const ContentSecurityPolicyDirective* violatedDirectiveForStyle(const URL&, bool didReceiveRedirectResponse ) const;74 const ContentSecurityPolicyDirective* violatedDirectiveForScript(const URL&, bool didReceiveRedirectResponse, const Vector<ResourceCryptographicDigest>&, const String&) const; 75 const ContentSecurityPolicyDirective* violatedDirectiveForStyle(const URL&, bool didReceiveRedirectResponse, const String&) const; 80 76 81 77 const ContentSecurityPolicyDirective* defaultSrc() const { return m_defaultSrc.get(); }
Note: See TracChangeset
for help on using the changeset viewer.