| OLD | NEW |
| (Empty) |
| 1 <script> | |
| 2 if (window.testRunner) { | |
| 3 testRunner.dumpAsText(); | |
| 4 testRunner.waitUntilDone(); | |
| 5 } | |
| 6 | |
| 7 window.addEventListener("load", function() { | |
| 8 var cookie = document.cookie; | |
| 9 | |
| 10 if (/font/.test(cookie) || /import/.test(cookie)) | |
| 11 alert("FAIL! Cookies received: " + cookie); | |
| 12 else if (/img/.test(cookie)) | |
| 13 alert("PASS"); | |
| 14 else | |
| 15 alert("FAIL: Did not receive any cookies.") | |
| 16 | |
| 17 document.cookie = "img=; Max-Age=-1; Path=/"; | |
| 18 document.cookie = "font=; Max-Age=-1; Path=/"; | |
| 19 document.cookie = "import=; Max-Age=-1; Path=/"; | |
| 20 | |
| 21 if (window.testRunner) | |
| 22 testRunner.notifyDone(); | |
| 23 }, false); | |
| 24 </script> | |
| 25 First we load an image as a control to make sure we can set cookies:<br> | |
| 26 <img src="http://127.0.0.1:8000/security/resources/set-cookie.php?name=img&v
alue=PASS"> | |
| 27 | |
| 28 Then we load an SVGImage to see if we can issue network requests from inside the
image:<br> | |
| 29 <img height=200px src='data:image/svg+xml;utf8, | |
| 30 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin
k"> | |
| 31 <defs> | |
| 32 | |
| 33 <style type="text/css"> | |
| 34 @font-face { font-family: Extern2; src: url(http://127.0.0.1:8000/security/resou
rces/set-cookie.php?name=font&amp;value=FAIL) format("woff"); } | |
| 35 | |
| 36 .cc { | |
| 37 font-family: Extern2; | |
| 38 font-size: 20px; | |
| 39 } | |
| 40 </style> | |
| 41 | |
| 42 <style type="text/css"> | |
| 43 @import url("http://127.0.0.1:8000/security/resources/set-cookie.php?name=import
&amp;value=FAIL"); | |
| 44 </style> | |
| 45 </defs> | |
| 46 | |
| 47 <polygon id="triangle" points="0,0 0,50 50,0" fill="#00FF00" stroke="#004400"/> | |
| 48 <text x="50" y="50" class="cc">groebert</text> | |
| 49 | |
| 50 </svg> | |
| 51 '> | |
| OLD | NEW |