Changeset 199605 in webkit
- Timestamp:
- Apr 15, 2016, 12:49:58 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 5 deleted
- 8 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r199604 r199605 1 2016-04-15 Brent Fulgham <bfulgham@apple.com> 2 3 Remove support for X-Frame-Options in `<meta>` 4 https://bugs.webkit.org/show_bug.cgi?id=156625 5 <rdar://problem/25748714> 6 7 Reviewed by Darin Adler. 8 9 Revise tests to match our desired behavior based on RFC 7034 (Section 4). 10 11 * http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html: 12 * http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html: 13 * http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html: 14 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: Removed. 15 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: Removed. 16 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html: Removed. 17 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow-expected.txt: Removed. 18 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html: Removed. 19 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: Removed. 20 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html: Removed. 21 * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html: Removed. 22 * http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-expected.txt: Added. 23 * http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body-expected.txt: Added. 24 * http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html: Copied from LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html. 25 * http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow-expected.txt: Added. 26 * http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html: Copied from LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html. 27 * http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny-expected.txt: Added. 28 * http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html: Copied from LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html. 29 * http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html: Copied from LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html. 30 * http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-expected.txt: Removed. 31 * http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored-expected.txt: Added. 32 * http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored.html: Copied from LayoutTests/http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options.html. 33 * http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options.html: Removed. 34 * inspector/console/x-frame-options-message-expected.txt: Rebaselined. 35 * platform/win/TestExpectations: 36 1 37 2016-04-15 Jiewen Tan <jiewen_tan@apple.com> 2 38 -
trunk/LayoutTests/http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html
r42333 r199605 3 3 </head> 4 4 <body> 5 <p> FAIL: This should show up and disappear immediately.</p>5 <p>PASS: This should be displayed.</p> 6 6 <meta http-equiv="x-frame-options" content="deny" /> 7 <p> FAIL: This should never show up.</p>7 <p>PASS: This should also be displayed.</p> 8 8 </body> 9 9 </html> -
trunk/LayoutTests/http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html
r42333 r199605 4 4 </head> 5 5 <body> 6 <p> FAIL: This should not show up as the parent is not in the same origin.</p>6 <p>PASS: This should show up even though the parent is not in the same origin because we should be ignoring the meta tag.</p> 7 7 </body> 8 8 </html> -
trunk/LayoutTests/http/tests/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html
r42333 r199605 4 4 </head> 5 5 <body> 6 <p> FAIL: This should not show up.</p>6 <p>PASS: This should be displayed.</p> 7 7 </body> 8 8 </html> -
trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html
r199570 r199605 11 11 12 12 if (!url) 13 console.log(" PASS: Could not read contentWindow.location.href");13 console.log("FAIL: Could not read contentWindow.location.href"); 14 14 else 15 console.log(" FAIL: Could read contentWindow.location.href");15 console.log("PASS: Could read contentWindow.location.href"); 16 16 testRunner.notifyDone(); 17 17 } 18 18 </script> 19 19 20 <p>There should be nocontent in the iframe below</p>20 <p>There should be content in the iframe below</p> 21 21 <iframe style="width:500px; height:500px" src="http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-in-body.html" onload="checkIfDone()"></iframe> -
trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html
r199570 r199605 11 11 12 12 if (!url) 13 console.log(" PASS: Could not read contentWindow.location.href");13 console.log("FAIL: Could not read contentWindow.location.href"); 14 14 else 15 console.log(" FAIL: Could read contentWindow.location.href");15 console.log("PASS: Could read contentWindow.location.href"); 16 16 testRunner.notifyDone(); 17 17 } 18 18 </script> 19 19 20 <p>There should be nocontent in the iframe below</p>20 <p>There should be content in the iframe below</p> 21 21 <iframe style="width:500px; height:500px" src="http://localhost:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe-parent-same-origin-deny.html" onload="checkIfDone()"></iframe> -
trunk/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html
r199570 r199605 11 11 12 12 if (!url) 13 console.log(" PASS: Could not read contentWindow.location.href");13 console.log("FAIL: Could not read contentWindow.location.href"); 14 14 else 15 console.log(" FAIL: Could read contentWindow.location.href");15 console.log("PASS: Could read contentWindow.location.href"); 16 16 testRunner.notifyDone(); 17 17 } 18 18 </script> 19 19 20 <p>There should be nocontent in the iframe below</p>20 <p>There should be content in the iframe below</p> 21 21 <iframe style="width:500px; height:500px" src="http://127.0.0.1:8000/security/XFrameOptions/resources/x-frame-options-deny-meta-tag-subframe.html" onload="checkIfDone()"></iframe> -
trunk/LayoutTests/inspector/console/x-frame-options-message-expected.txt
r188598 r199605 1 CONSOLE MESSAGE: line 41: Refused to display 'x-frame-options-message.html' in a frame because it set 'X-Frame-Options' to 'deny'.1 CONSOLE MESSAGE: line 41: X-Frame-Options may only be set via an HTTP header sent along with a document. It may not be set inside <meta>. 2 2 3 3 -
trunk/LayoutTests/platform/win/TestExpectations
r199585 r199605 2185 2185 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options-deny.html [ Failure ] 2186 2186 webkit.org/b/140703 [ Debug ] http/tests/security/XFrameOptions/x-frame-options-deny-delete-frame-in-load-event.html [ Crash ] 2187 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options- deny-meta-tag-in-body.html [ Failure ]2188 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options- deny-meta-tag-parent-same-origin-allow.html [ Crash Failure ]2189 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options- deny-meta-tag-parent-same-origin-deny.html [ Crash Failure ]2190 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options- deny-meta-tag.html [ Crash Failure ]2187 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html [ Failure ] 2188 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html [ Crash Failure ] 2189 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html [ Crash Failure ] 2190 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html [ Crash Failure ] 2191 2191 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options-invalid.html [ Failure ] 2192 2192 webkit.org/b/140703 http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r199603 r199605 1 2016-04-15 Brent Fulgham <bfulgham@apple.com> 2 3 Remove support for X-Frame-Options in `<meta>` 4 https://bugs.webkit.org/show_bug.cgi?id=156625 5 <rdar://problem/25748714> 6 7 Reviewed by Darin Adler. 8 9 Follow RFC7034 (Section 4), which recommends that 'X-Frame-Options' be ignored when delivered as part of 10 a '<meta http-equiv="...">' tag. This brings us in line with Firefox, Edge, and Blink. 11 12 Tests: http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-in-body.html 13 http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-allow.html 14 http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag-parent-same-origin-deny.html 15 http/tests/security/XFrameOptions/x-frame-options-ignore-deny-meta-tag.html 16 http/tests/security/xssAuditor/meta-tag-http-refresh-x-frame-options-ignored.html 17 18 * dom/Document.cpp: 19 (WebCore::Document::processHttpEquiv): Log error message instead of blocking the load. 20 1 21 2016-04-15 Jer Noble <jer.noble@apple.com> 2 22 -
trunk/Source/WebCore/dom/Document.cpp
r199538 r199605 3305 3305 if (frameLoader.activeDocumentLoader() && frameLoader.activeDocumentLoader()->mainResourceLoader()) 3306 3306 requestIdentifier = frameLoader.activeDocumentLoader()->mainResourceLoader()->identifier(); 3307 if (frameLoader.shouldInterruptLoadForXFrameOptions(content, url(), requestIdentifier)) { 3308 String message = "Refused to display '" + url().stringCenterEllipsizedToLength() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'."; 3309 frameLoader.stopAllLoaders(); 3310 // Stopping the loader isn't enough, as we're already parsing the document; to honor the header's 3311 // intent, we must navigate away from the possibly partially-rendered document to a location that 3312 // doesn't inherit the parent's SecurityOrigin. 3313 frame->navigationScheduler().scheduleLocationChange(this, securityOrigin(), SecurityOrigin::urlWithUniqueSecurityOrigin(), String()); 3314 addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, requestIdentifier); 3315 } 3307 3308 addConsoleMessage(MessageSource::Security, MessageLevel::Error, "X-Frame-Options may only be set via an HTTP header sent along with a document. It may not be set inside <meta>.", requestIdentifier); 3316 3309 } 3317 3310 break;
Note:
See TracChangeset
for help on using the changeset viewer.