<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>107389</bug_id>
          
          <creation_ts>2013-01-19 18:14:43 -0800</creation_ts>
          <short_desc>&lt;script crossorigin&gt; not handled correctly when server doesn&apos;t send the right headers</short_desc>
          <delta_ts>2013-04-02 05:26:08 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>pf</cc>
    
    <cc>rakeshpai</cc>
    
    <cc>syoichi</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>811520</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-19 18:14:43 -0800</bug_when>
    <thetext>Accordiing to https://bugzilla.mozilla.org/show_bug.cgi?id=832587#c0 a &lt;script crossorigin&gt; with a cross-origin URL to a server that&apos;s not sending the right access-control-allow-origin headers executes in Chrome.  That&apos;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 &apos;If mode is &quot;Anonymous&quot; or &quot;Use Credentials&quot;&apos; under &apos;If the CORS cross-origin request status is not success&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>814424</commentid>
    <comment_count>1</comment_count>
    <who name="Pablo Flouret">pf</who>
    <bug_when>2013-01-23 11:41:38 -0800</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>814436</commentid>
    <comment_count>2</comment_count>
    <who name="Pablo Flouret">pf</who>
    <bug_when>2013-01-23 11:49:32 -0800</bug_when>
    <thetext>Ah, i see the testcase in the bugzilla bug, looking at it now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>814722</commentid>
    <comment_count>3</comment_count>
    <who name="Pablo Flouret">pf</who>
    <bug_when>2013-01-23 15:12:52 -0800</bug_when>
    <thetext>I wasn&apos;t aware that when the parser triggers the script request it follows a different code path that doesn&apos;t end up in ScriptElement::notifyFinished() so the check is never done.

I&apos;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)?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>