blob: 6a04e9f13273357c2e643eb7bb42e8dece05fc5d [file] [edit]
CONSOLE MESSAGE: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/innocent-victim-with-notify.html from frame with URL http://127.0.0.1:8000/security/aboutBlank/xss-DENIED-navigate-opener-document-write.html. Domains, protocols and ports must match.
CONSOLE MESSAGE: line 1: TypeError: 'undefined' is not an object (evaluating 'target.document.body')
This page opens a window to "", injects malicious code, and then navigates its opener to the victim. The opened window then tries to scripts its opener after document.writeing a new document.
Code injected into window:
<script>document.write('<script>function write(target, message) { target.document.body.innerHTML = message; }setTimeout(function() {write(window.opener, \'FAIL: XSS was allowed.\');}, 100);setTimeout(function() {write(window.opener.top.frames[1], \'SUCCESS: Window remained in original SecurityOrigin.\');}, 200);setTimeout(function() { if (window.testRunner) testRunner.globalFlag = true; }, 300);<\/script>');</script>
--------
Frame: '<!--framePath //<!--frame0-->-->'
--------
This page doesn't do anything special (except signal that it has finished loading).
--------
Frame: '<!--framePath //<!--frame1-->-->'
--------
SUCCESS: Window remained in original SecurityOrigin.