Reviewed by Eric Seidel.
Missing checkout for getSVGDocument()
https://bugs.webkit.org/show_bug.cgi?id=29064
The V8 code generator didn't understand SVGCheckSecurityDocument.
Tests: http/tests/security/xss-DENIED-getSVGDocument-iframe.html
http/tests/security/xss-DENIED-getSVGDocument-object.html
* bindings/scripts/CodeGeneratorV8.pm:
2009-09-08 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
Missing checkout for getSVGDocument()
https://bugs.webkit.org/show_bug.cgi?id=29064
Add tests that getSVGDocument() has the proper checks.
* http/tests/security/resources/flag.php: Added.
* http/tests/security/xss-DENIED-getSVGDocument-iframe-expected.txt: Added.
* http/tests/security/xss-DENIED-getSVGDocument-iframe.html: Added.
* http/tests/security/xss-DENIED-getSVGDocument-object-expected.txt: Added.
* http/tests/security/xss-DENIED-getSVGDocument-object.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@48240
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-09-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Missing checkout for getSVGDocument()
+ https://bugs.webkit.org/show_bug.cgi?id=29064
+
+ Add tests that getSVGDocument() has the proper checks.
+
+ * http/tests/security/resources/flag.php: Added.
+ * http/tests/security/xss-DENIED-getSVGDocument-iframe-expected.txt: Added.
+ * http/tests/security/xss-DENIED-getSVGDocument-iframe.html: Added.
+ * http/tests/security/xss-DENIED-getSVGDocument-object-expected.txt: Added.
+ * http/tests/security/xss-DENIED-getSVGDocument-object.html: Added.
+
2009-09-09 Cameron McCormack <cam@mcc.id.au>
Reviewed by Eric Seidel.
--- /dev/null
+<?php\r
+header("Content-Type: image/svg+xml");\r
+?>\r
+<svg xmlns="http://www.w3.org/2000/svg"></svg>\r
--- /dev/null
+CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8080/security/resources/empty-svg.php from frame with URL http://127.0.0.1:8000/security/xss-DENIED-getSVGDocument-iframe.html. Domains, protocols and ports must match.
+
+
+PASS
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+function runTest() {
+ var svgDoc = document.getElementById("svgobject").getSVGDocument();
+ document.getElementById("output").innerHTML =
+ svgDoc ? "FAIL got SVGDocument: " + svgDoc : "PASS";
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+</script>
+</head>
+<body>
+<iframe onload="runTest()"
+ id="svgobject" src="http://localhost:8080/security/resources/empty-svg.php"
+ width="400" height="300"></iframe>
+<div id="output"></div>
+</body>
+</html>
--- /dev/null
+CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8080/security/resources/empty-svg.php from frame with URL http://127.0.0.1:8000/security/xss-DENIED-getSVGDocument-object.html. Domains, protocols and ports must match.
+
+
+PASS
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+function runTest() {
+ var svgDoc = document.getElementById("svgobject").getSVGDocument();
+ document.getElementById("output").innerHTML =
+ svgDoc ? "FAIL got SVGDocument: " + svgDoc : "PASS";
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+</script>
+</head>
+<body>
+<object onload="runTest()"
+ id="svgobject" data="http://localhost:8080/security/resources/empty-svg.php"
+ type="image/svg+xml" width="400" height="300"></object>
+<div id="output"></div>
+</body>
+</html>
+2009-09-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Missing checkout for getSVGDocument()
+ https://bugs.webkit.org/show_bug.cgi?id=29064
+
+ The V8 code generator didn't understand SVGCheckSecurityDocument.
+
+ Tests: http/tests/security/xss-DENIED-getSVGDocument-iframe.html
+ http/tests/security/xss-DENIED-getSVGDocument-object.html
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+
2009-09-09 Cameron McCormack <cam@mcc.id.au>
Reviewed by Eric Seidel.
push(@implContentDecls, " ScriptCallStack callStack(args, $numParameters);\n");
$implIncludes{"ScriptCallStack.h"} = 1;
}
+ if ($function->signature->extendedAttributes->{"SVGCheckSecurityDocument"}) {
+ push(@implContentDecls,
+" if (!V8Proxy::checkNodeSecurity(imp->getSVGDocument(ec)))\n" .
+" return v8::Undefined();\n");
+ }
my $paramIndex = 0;
foreach my $parameter (@{$function->parameters}) {