<?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>26898</bug_id>
          
          <creation_ts>2014-09-24 20:07:27 +0000</creation_ts>
          <short_desc>[imports]: &lt;link rel=import&gt; shouldn&apos;t be active when added by innerHTML</short_desc>
          <delta_ts>2015-07-06 08:16:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</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>
          
          <blocked>20683</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Morrita Hajime">morrita</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>fbraun</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>112116</commentid>
    <comment_count>0</comment_count>
    <who name="Morrita Hajime">morrita</who>
    <bug_when>2014-09-24 20:07:27 +0000</bug_when>
    <thetext>Reported at https://code.google.com/p/chromium/issues/detail?id=416036
As &lt;script&gt;, it should be disabled when injected by innerHTML.
cf. http://www.w3.org/TR/2008/WD-html5-20080610/dom.html#innerhtml0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112125</commentid>
    <comment_count>1</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2014-09-24 20:51:51 +0000</bug_when>
    <thetext>Why?

The &lt;script&gt; thing was mostly done in order to get compatibility with existing content. Specifically there was a lot of content out there that did things like:

&lt;div id=elem&gt;
  &lt;script&gt;...&lt;/script&gt;
  lots of content here
&lt;div&gt;

document.getElementById(&apos;elem&apos;).innerHTML += &quot;hello world&quot;;

This code did not expect the script elements to execute again because back in those days dynamically inserted &lt;script&gt; elements almost never executed.

I don&apos;t think any of those reasons apply here.

First of all &quot;reimporting&quot; the same URL is a no-op since we de-duplicate imports, right?

Second, there&apos;s no existing content that we need to be compatible with since imports are a new feature.


The reason I&apos;d rather not make exceptions for innerHTML is that it creates arbitrary and hard-to-learn inconsistencies. Why innerHTML but not outerHTML or insertAdjecentHTML? What about the jQuery provided $(&quot;markup here&quot;) and parseHTML?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112145</commentid>
    <comment_count>2</comment_count>
    <who name="Morrita Hajime">morrita</who>
    <bug_when>2014-09-24 22:24:07 +0000</bug_when>
    <thetext>Good question. Your points are valid.

I heard that the &lt;script&gt; blacklisting is a safeguard for reducing XSS.
Is it misunderstanding the intention of the spec?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112151</commentid>
    <comment_count>3</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2014-09-24 22:35:34 +0000</bug_when>
    <thetext>The current limitation was mainly added in order to be compatible with the web. It was originally not added for any security reasons.

I don&apos;t think that blocking &lt;script&gt; in innerHTML is a meaningful XSS-prevention mechanism. But others might disagree.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121743</commentid>
    <comment_count>4</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-07-06 08:16:16 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcomponents/issues/193</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>