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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21506</bug_id>
          
          <creation_ts>2013-04-02 09:31:09 +0000</creation_ts>
          <short_desc>Data URLs should not inherit the origin after a redirect.</short_desc>
          <delta_ts>2013-09-12 20:16:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#sandboxOrigin</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85364</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-04-02 09:31:09 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html
Multipage: http://www.whatwg.org/C#sandboxOrigin
Complete: http://www.whatwg.org/c#sandboxOrigin

Comment:
Data URLs should not inherit the origin after a redirect.

Posted from: 207.218.72.65 by annevk@annevk.nl
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85365</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-04-02 09:33:15 +0000</bug_when>
    <thetext>Consider a cross-origin URL that redirects to a same-origin URL open redirector. The cross-origin URL can cause the same-origin URL redirector to output a data URL that might harm the site in question.

I hope to clarify this in Fetch too, but updating HTML meanwhile might be good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85390</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-04-02 14:46:05 +0000</bug_when>
    <thetext>Note that in Gecko, redirects to a data: URL do not in fact inherit any origins, last I checked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85808</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-09 17:57:44 +0000</bug_when>
    <thetext>As far as I can tell, the spec already says that. Specifically, it has this entry:

   If a Document was generated from a data: URL that was
   returned as the location of an HTTP redirect (or
   equivalent in other protocols)

      The origin is an alias to the origin of the URL that
      redirected to the data: URL.

Anne: Am I missing something?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85810</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-04-09 17:59:18 +0000</bug_when>
    <thetext>This is a bug about having it NOT be an alias and instead having it be a new uniquer origin, as far as I can tell.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85811</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-04-09 18:12:38 +0000</bug_when>
    <thetext>Indeed. Also, that does not address the case for &lt;img&gt;, &lt;script&gt;, and other sources that take a data URL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86018</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-12 06:58:15 +0000</bug_when>
    <thetext>Oh, I see. Yeah, that seems reasonable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88525</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-05-31 20:12:27 +0000</bug_when>
    <thetext>Aren&apos;t &lt;img&gt; and &lt;script&gt; already handled by the potentially-CORS logic?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88526</commentid>
    <comment_count>8</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-05-31 20:13:19 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7881.
Check-in comment: Security: data: URLs shouldn&apos;t get the origin of a redirector, since that redirector might be tricked into redirecting a data: URLs by a hostile origin, thus letting that hostile origin expose a same-origin data: URL.
http://html5.org/tools/web-apps-tracker?from=7880&amp;to=7881</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89194</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-06-12 19:06:07 +0000</bug_when>
    <thetext>I&apos;ve only done the definition for Documents. Let me know if I need to do more, I couldn&apos;t work out what you meant for &lt;img&gt; etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89262</commentid>
    <comment_count>10</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-06-13 15:53:03 +0000</bug_when>
    <thetext>I think the question is what happens if you have a cross-origin image load that redirects to a data URL.  And the answer is that the resulting image should NOT be considered same-origin with the linking document for things like canvas tainting and whatnot. 

As long as this is what happens now, we&apos;re good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89420</commentid>
    <comment_count>11</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-06-17 22:17:52 +0000</bug_when>
    <thetext>Well as soon as you go cross-origin, it ends up not being same-origin, so I don&apos;t think the problem occurs. (Only way I guess it could occur is if the CORS headers from the redirect somehow applied to the data: URL, but I don&apos;t think that happens. If it does, it&apos;d be a bug in CORS, not HTML.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89549</commentid>
    <comment_count>12</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-06-19 06:11:13 +0000</bug_when>
    <thetext>Do we want same-origin -&gt; data URLs to be considered same-origin though? I thought that was a case we did not want to allow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90153</commentid>
    <comment_count>13</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-07-02 22:01:38 +0000</bug_when>
    <thetext>Why would we not want to allow it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91793</commentid>
    <comment_count>14</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-08-08 13:59:08 +0000</bug_when>
    <thetext>The one I see is a page that allows pasting in same-origin links that open in an &lt;iframe&gt; of sorts and they also have an open-re-director going.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91807</commentid>
    <comment_count>15</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-08-08 22:07:08 +0000</bug_when>
    <thetext>I don&apos;t think I&apos;ve ever seen such a page, but I dunno... Do you have an example?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91808</commentid>
    <comment_count>16</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-08-08 22:07:36 +0000</bug_when>
    <thetext>(It would have to be a page that does that, but still blocks direct data: URLs.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93310</commentid>
    <comment_count>17</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-09-12 20:16:05 +0000</bug_when>
    <thetext>For Documents, even same-origin redirects to data: end up with a unique origin.
For images, we&apos;re already treating them specially in HTML, and the fetch spec is taking that over anyway.

I think we&apos;re done here. Reopen if I missed something.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>