Title: [100471] trunk/LayoutTests
Revision
100471
Author
commit-qu...@webkit.org
Date
2011-11-16 11:03:00 -0800 (Wed, 16 Nov 2011)

Log Message

ScriptController::executeIfJavaScriptURL gets confused by synchronous frame loads
https://bugs.webkit.org/show_bug.cgi?id=69777

Patch by Sergey Glazunov <serg.glazu...@gmail.com> on 2011-11-16
Reviewed by Adam Barth.

* http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url-expected.txt: Added.
* http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (100470 => 100471)


--- trunk/LayoutTests/ChangeLog	2011-11-16 18:56:08 UTC (rev 100470)
+++ trunk/LayoutTests/ChangeLog	2011-11-16 19:03:00 UTC (rev 100471)
@@ -1,3 +1,13 @@
+2011-11-16  Sergey Glazunov  <serg.glazu...@gmail.com>
+
+        ScriptController::executeIfJavaScriptURL gets confused by synchronous frame loads
+        https://bugs.webkit.org/show_bug.cgi?id=69777
+
+        Reviewed by Adam Barth.
+
+        * http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url-expected.txt: Added.
+        * http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url.html: Added.
+
 2011-11-16  Yusuke Suzuki  <utatane....@gmail.com>
 
         String new RegExp('\n').toString() returns is invalid RegularExpressionLiteral

Added: trunk/LayoutTests/http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url-expected.txt (0 => 100471)


--- trunk/LayoutTests/http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url-expected.txt	2011-11-16 19:03:00 UTC (rev 100471)
@@ -0,0 +1,3 @@
+CONSOLE MESSAGE: line 1: Unsafe _javascript_ attempt to access frame with URL http://localhost:8080/security/resources/innocent-victim.html from frame with URL about:blank. Domains, protocols and ports must match.
+
+This test passes if there's no alert dialog.  

Added: trunk/LayoutTests/http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url.html (0 => 100471)


--- trunk/LayoutTests/http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/security/xss-DENIED-synchronous-frame-load-in-_javascript_-url.html	2011-11-16 19:03:00 UTC (rev 100471)
@@ -0,0 +1,42 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+	layoutTestController.dumpAsText();
+	layoutTestController.waitUntilDone();
+	layoutTestController.setCanOpenWindows();
+	layoutTestController.setCloseRemainingWindowsWhenComplete(true);
+}
+
+window._onload_ = function()
+{
+	victim = document.body.appendChild(document.createElement("iframe"));
+	wnd = victim.contentWindow.open();
+	victim.src = ""
+	victim._onload_ = function() {
+		victim._onload_ = null;
+
+		wnd.eval("(" + function() {
+			location = "_javascript_:(" + function() {
+				a = document.createElement("a");
+				a.href = ""
+				e = document.createEvent("MouseEvent");
+				e.initMouseEvent("click");
+				a.dispatchEvent(e);
+
+				return "<script>(" + function() {
+					opener.location = "_javascript_:alert(document.body.innerHTML)";
+
+					if (window.layoutTestController)
+						setTimeout("layoutTestController.notifyDone()", 0);
+				} + ")()<\/script>";
+			} + ")()";
+		} + ")()");
+	}
+}
+</script>
+</head>
+<body>
+This test passes if there's no alert dialog.
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to