NEW 107389
<script crossorigin> not handled correctly when server doesn't send the right headers
https://bugs.webkit.org/show_bug.cgi?id=107389
Summary <script crossorigin> not handled correctly when server doesn't send the right...
Boris Zbarsky
Reported 2013-01-19 18:14:43 PST
Accordiing to https://bugzilla.mozilla.org/show_bug.cgi?id=832587#c0 a <script crossorigin> with a cross-origin URL to a server that's not sending the right access-control-allow-origin headers executes in Chrome. That's not what the spec says to do. In particular, see http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#potentially-cors-enabled-fetch the part about 'If mode is "Anonymous" or "Use Credentials"' under 'If the CORS cross-origin request status is not success'.
Attachments
Pablo Flouret
Comment 1 2013-01-23 11:41:38 PST
Do you have a testcase that i can look at? Otherwise, if i understand you correctly, this test does what you mean, no? http://trac.webkit.org/browser/trunk/LayoutTests/http/tests/security/script-with-failed-cors-check-fails-to-load.html
Pablo Flouret
Comment 2 2013-01-23 11:49:32 PST
Ah, i see the testcase in the bugzilla bug, looking at it now.
Pablo Flouret
Comment 3 2013-01-23 15:12:52 PST
I wasn't aware that when the parser triggers the script request it follows a different code path that doesn't end up in ScriptElement::notifyFinished() so the check is never done. I'm not super familiar with how the parser does things, is HTMLScriptRunner::executePendingScriptAndDispatchEvent() the right place to do the CORS check (or HTMLScriptRunner::runScript(), or both)?
Note You need to log in before you can comment on or make changes to this bug.