<?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>25699</bug_id>
          
          <creation_ts>2014-05-13 23:49:02 +0000</creation_ts>
          <short_desc>appcache: limit FALLBACK namespaces entries to subpaths of the manifest itself (not just same-origin)</short_desc>
          <delta_ts>2014-09-03 21:39:42 +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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ian &apos;Hixie&apos; Hickson">ian</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>aaj+w3c</cc>
    
    <cc>fbraun</cc>
    
    <cc>hbambas</cc>
    
    <cc>hober0</cc>
    
    <cc>ian</cc>
    
    <cc>johnme</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>w3c</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105932</commentid>
    <comment_count>0</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-13 23:49:02 +0000</bug_when>
    <thetext>Right now, if you XSS a site and inject a manifest into a page, that manifest can take over the entire origin. If we limit FALLBACK entries to only being subpaths of the manifest&apos;s URL, it would mitigate this to only being able to take over the section of the origin where the manifest is being hosted. Usually, you&apos;re not going to be able to upload a manifest into the root of the origin, one hopes.

Question: is this sufficiently Web-compatible?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106159</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-05-16 13:11:09 +0000</bug_when>
    <thetext>In webdevdata data set 2013-09-01 102,000 pages I see 4 sites having non-root manifests

timer-tab.com manifest=&apos;sf/main.appcache&apos;
20thingsilearned.com manifest=&quot;/en-US/cache.manifest?v=49&quot;
greynium.com manifest=&quot;http://www.greynium.com/wp-content/themes/greynium/cache.manifest&quot;
ptable.com manifest=&quot;Static/manifest.remove&quot;

Some of them have since changed, and none of them use FALLBACK today as far as I can tell.

It&apos;s possible that manifests are more common in intranets though.

A slightly more aggressive approach could be to disable FALLBACK if the manifest is not at the root.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106251</commentid>
    <comment_count>2</comment_count>
    <who name="Artur Janc">aaj+w3c</who>
    <bug_when>2014-05-17 23:04:03 +0000</bug_when>
    <thetext>So the goal here is only to prevent the manifest from hijacking unrelated legitimate resource loads from the manifest&apos;s origin, correct?

IIUC this wouldn&apos;t prevent a potentially evil manifest entry from re-introducing an evil script to the XSS-ed origin. The attacker could just specify a FALLBACK entry for a subpath of the manifest&apos;s URL pointing to an evil resource, and have it execute in the context of the vulnerable domain at some point in the future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106368</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-19 19:52:06 +0000</bug_when>
    <thetext>The problem isn&apos;t so much preventing XSS — to do anything here you have to have an XSS vector — the problem is more about preventing a reflecting XSS vector from being leveraged into a site-wide redirect for the targeted user, causing all content to redirect to a given page.

Just being able to run _script_ doesn&apos;t let you escalate your manifest privileges, you need some way to get the site to serve a manifest as well. The idea of this mitigation is that the site&apos;s vulnerability with respect to where a file can be uploaded is likely to not always be on the root.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107009</commentid>
    <comment_count>4</comment_count>
    <who name="Honza Bambas (mozilla)">hbambas</who>
    <bug_when>2014-05-29 22:47:25 +0000</bug_when>
    <thetext>To make it more clear: we want to limit the _namespace_ of a FALLBACK entry, not the target fallback resource we redirect to on an error.

According our global telemetry top level pages loaded from appcache is around 0.01% of all cached page loads.  In numbers, it&apos;s ~3.3M top level page loads from appcache per one of our release cycles (6 weeks) on the release channel.

I personally have no more data to base the decision on, but appcache is a dead technology that should be altered with Service Workers - in progress.

According a browser implementation I could imagine an error page (similar to SSL certificate error page) appearing when falling back to root/outside the manifest containing path.  A warning message + suggestion to report the problem to owner of the site would appear.  Potentially, user would be able to continue on its own risk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110931</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-03 21:39:27 +0000</bug_when>
    <thetext>Ok, I&apos;ve specced the mitigation described here. Let me know if browsers don&apos;t want to implement this. Not sure what else we can do, but we can at least mention in the spec that the mitigation, such as it is, hasn&apos;t been implemented.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110932</commentid>
    <comment_count>6</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-09-03 21:39:42 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8739.
Check-in comment: Attempt to mitigate the injection elevation attack on appcache, and describe the attack in detail
http://html5.org/tools/web-apps-tracker?from=8738&amp;to=8739</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>