Commit 02562e3
cdumez@apple.com
Disallow alert/confirm/prompt in cross-origin-domain subframes
https://bugs.webkit.org/show_bug.cgi?id=221568
Reviewed by Geoff Garen.
Source/WebCore:
Disallow alert/confirm/prompt in cross-origin-domain subframes as per the latest HTML specification:
- whatwg/html#6297
Tests: http/tests/security/cross-origin-js-prompt-forbidden.html
http/tests/security/same-origin-different-domain-js-prompt-forbidden.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::alert):
(WebCore::DOMWindow::confirmForBindings):
(WebCore::DOMWindow::prompt):
* page/SecurityOrigin.cpp:
* page/SecurityOrigin.h:
LayoutTests:
Add layout test coverage and update existing tests to stop using alert() in cross-origin iframes.
* fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame-expected.txt:
* fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html:
* fast/events/popup-when-select-change-expected.txt:
* fast/events/popup-when-select-change.html:
* fast/events/resize-subframe-expected.txt:
* fast/events/resize-subframe.html:
* fast/forms/autofocus-in-sandbox-with-allow-scripts-expected.txt:
* fast/forms/autofocus-in-sandbox-with-allow-scripts.html:
* fast/frames/resources/navigate-top-by-name-to-fail.html:
* fast/frames/sandboxed-iframe-navigation-top-by-name-denied-expected.txt:
* http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html:
* http/tests/cookies/third-party-cookie-relaxing-expected.txt:
* http/tests/history/cross-origin-replace-history-object-child-expected.txt:
* http/tests/history/cross-origin-replace-history-object-expected.txt:
* http/tests/history/resources/cross-origin-replaces-history-object-child-iframe.html:
* http/tests/history/resources/cross-origin-replaces-history-object-iframe.html:
* http/tests/plugins/resources/third-party-cookie-accept-policy-iframe.html:
* http/tests/plugins/third-party-cookie-accept-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/embed-redirect-allowed-expected.txt:
* http/tests/security/contentSecurityPolicy/embed-redirect-allowed2-expected.txt:
* http/tests/security/contentSecurityPolicy/frame-src-cross-origin-load-expected.txt:
* http/tests/security/contentSecurityPolicy/iframe-allowed-when-loaded-via-javascript-url-expected.txt:
* http/tests/security/contentSecurityPolicy/iframe-inside-csp-expected.txt:
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src-expected.txt:
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-child-src2-expected.txt:
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src-expected.txt:
* http/tests/security/contentSecurityPolicy/iframe-redirect-allowed-by-frame-src2-expected.txt:
* http/tests/security/contentSecurityPolicy/object-redirect-allowed-expected.txt:
* http/tests/security/contentSecurityPolicy/object-redirect-allowed2-expected.txt:
* http/tests/security/contentSecurityPolicy/resources/alert-fail.html:
* http/tests/security/contentSecurityPolicy/resources/alert-fail.js:
(catch):
* http/tests/security/contentSecurityPolicy/resources/alert-pass.html:
* http/tests/security/contentSecurityPolicy/resources/alert-pass.js:
(catch):
* http/tests/security/contentSecurityPolicy/resources/sandbox.php:
* http/tests/security/contentSecurityPolicy/resources/sandboxed-eval.php:
* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header-control-expected.txt:
* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header-expected.txt:
* http/tests/security/contentSecurityPolicy/sandbox-report-only-expected.txt:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-nested-upgrades-expected.txt:
* http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/upgrades-mixed-content-expected.txt:
* http/tests/security/cross-origin-js-prompt-forbidden-expected.txt: Added.
* http/tests/security/cross-origin-js-prompt-forbidden.html: Added.
* http/tests/security/dataURL/resources/foreign-domain-data-url-accessor-iframe.html:
* http/tests/security/dataURL/resources/foreign-domain-data-url-accessor-opened-frame.html:
* http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-subframe-expected.txt:
* http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-window-open-expected.txt:
* http/tests/security/mixedContent/resources/frame-with-insecure-websocket.html:
* http/tests/security/mixedContent/websocket/insecure-websocket-in-iframe-expected.txt:
* http/tests/security/resources/cross-origin-js-prompt-forbidden.html: Added.
* http/tests/security/same-origin-different-domain-js-prompt-forbidden-expected.txt: Added.
* http/tests/security/same-origin-different-domain-js-prompt-forbidden.html: Added.
* http/tests/security/xssAuditor/base-href-control-char-expected.txt:
* http/tests/security/xssAuditor/base-href-direct-expected.txt:
* http/tests/security/xssAuditor/base-href-expected.txt:
* http/tests/security/xssAuditor/base-href-null-char-expected.txt:
* http/tests/security/xssAuditor/base-href-safe-expected.txt:
* http/tests/security/xssAuditor/base-href-safe2-expected.txt:
* http/tests/security/xssAuditor/base-href-safe3-expected.txt:
* http/tests/security/xssAuditor/base-href-scheme-relative-expected.txt:
* http/tests/security/xssAuditor/cached-frame-expected.txt:
* http/tests/security/xssAuditor/cached-frame.html:
* http/tests/security/xssAuditor/cookie-injection-expected.txt:
* http/tests/security/xssAuditor/data-urls-work-expected.txt:
* http/tests/security/xssAuditor/data-urls-work.html:
* http/tests/security/xssAuditor/dom-write-innerHTML-expected.txt:
* http/tests/security/xssAuditor/dom-write-innerHTML.html:
* http/tests/security/xssAuditor/form-action-expected.txt:
* http/tests/security/xssAuditor/formaction-on-button-expected.txt:
* http/tests/security/xssAuditor/formaction-on-input-expected.txt:
* http/tests/security/xssAuditor/javascript-link-safe-expected.txt:
* http/tests/security/xssAuditor/javascript-link-safe.html:
* http/tests/security/xssAuditor/property-escape-noquotes-expected.txt:
* http/tests/security/xssAuditor/property-escape-noquotes-tab-slash-chars-expected.txt:
* http/tests/security/xssAuditor/property-escape-noquotes-tab-slash-chars.html:
* http/tests/security/xssAuditor/property-escape-noquotes.html:
* http/tests/security/xssAuditor/property-inject-expected.txt:
* http/tests/security/xssAuditor/property-inject.html:
* http/tests/security/xssAuditor/resources/base-href/really-safe-script.js:
* http/tests/security/xssAuditor/resources/base-href/safe-script.js:
* http/tests/security/xssAuditor/resources/echo-intertag.pl:
* http/tests/security/xssAuditor/resources/javascript-link-safe.html:
* http/tests/security/xssAuditor/resources/nph-cached.pl:
* http/tests/security/xssAuditor/resources/safe-script-noquotes.js:
* http/tests/security/xssAuditor/resources/safe-script.js:
* http/tests/security/xssAuditor/resources/script-tag-safe2.html:
* http/tests/security/xssAuditor/script-tag-near-start-expected.txt:
* http/tests/security/xssAuditor/script-tag-near-start.html:
* http/tests/security/xssAuditor/script-tag-safe2-expected.txt:
* http/tests/security/xssAuditor/script-tag-safe2.html:
* http/tests/security/xssAuditor/script-tag-safe3-expected.txt:
* http/tests/security/xssAuditor/script-tag-safe3.html:
* http/tests/security/xssAuditor/script-tag-src-redirect-safe-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-injected-comment-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-injected-comment.html:
* http/tests/security/xssAuditor/script-tag-with-source-same-host-expected.txt:
* platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests/proper-nested-upgrades-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@272607 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 1ea0e89 commit 02562e3
137 files changed
Lines changed: 658 additions & 410 deletions
File tree
- LayoutTests
- fast
- events
- forms
- frames
- resources
- http/tests
- cookies
- resources
- history
- resources
- misc
- resources
- plugins
- resources
- security
- contentSecurityPolicy
- resources
- upgrade-insecure-requests
- dataURL
- resources
- mixedContent
- resources
- websocket
- resources
- xssAuditor
- resources
- base-href
- xmlhttprequest
- platform/wk2/http/tests/security/contentSecurityPolicy/upgrade-insecure-requests
- plugins
- Source/WebCore
- page
- Tools/DumpRenderTree/TestNetscapePlugIn
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
1 | 109 | | |
2 | 110 | | |
3 | 111 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
0 commit comments