<?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>24822</bug_id>
          
          <creation_ts>2014-02-26 17:23:23 +0000</creation_ts>
          <short_desc>Clarification request: Is remote to local allowed?</short_desc>
          <delta_ts>2016-01-04 14:38:21 +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>Fetch</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>blocked on detailed implementer input</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nicholas C Zakas">nicholas</reporter>
          <assigned_to name="Mike West">mkwst</assigned_to>
          <cc>annevk</cc>
    
    <cc>jaffathecake</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>mkwst</cc>
    
    <cc>robin</cc>
    
    <cc>w3c</cc>
          
          <qa_contact>sideshowbarker+fetchspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101443</commentid>
    <comment_count>0</comment_count>
    <who name="Nicholas C Zakas">nicholas</who>
    <bug_when>2014-02-26 17:23:23 +0000</bug_when>
    <thetext>This currently works in all browsers supporting CORS:

* Setup a local web server such that cannot be accessed remotely. It responds with Access-Control-Allow-Origin: * for everything.
* Load up a remote web app, say app.nczonline.net.
* Inside of the web app, make an Ajax request to http://localhost:1234/resource

There&apos;s nothing in the spec that says it shouldn&apos;t work, and so it does. The question I had is if this was an oversight (and therefore a bad idea to take advantage of) or a supported feature of CORS (in which case it&apos;s safe to assume it&apos;s not going away in the future).

It seems like the question of whether or not remote resources should ever be able to access local resources is a higher-level security concern that needs to be addressed in the spec in some way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102650</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-03-19 16:16:55 +0000</bug_when>
    <thetext>So what is we want to do here?

If URLs are not same-origin, and the target URL&apos;s host is &quot;localhost&quot;, return a network error?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106832</commentid>
    <comment_count>2</comment_count>
    <who name="Jake Archibald">jaffathecake</who>
    <bug_when>2014-05-27 10:31:21 +0000</bug_when>
    <thetext>Say I&apos;m developing locally, and I have a local version of some API for testing purposes, would jakearchibald.dev (which maps to localhost) be able to reach localhost:3000?

Would jakearchibald.dev be able to talk to jakearchibald.dev:3000?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106833</commentid>
    <comment_count>3</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2014-05-27 10:45:09 +0000</bug_when>
    <thetext>(In reply to Jake Archibald from comment #2)
&gt; Say I&apos;m developing locally, and I have a local version of some API for
&gt; testing purposes, would jakearchibald.dev (which maps to localhost) be able
&gt; to reach localhost:3000?
&gt; 
&gt; Would jakearchibald.dev be able to talk to jakearchibald.dev:3000?

My expectation here would be that localhost (as a name) would be blocked, as would explicit access to 127.0.0.1 or ::1. Possibly, likewise for explicit access to the user&apos;s IP.

But names mapping to loopback would not be affected so jakearchibald.dev could talk to jakearchihairy.dev.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106835</commentid>
    <comment_count>4</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2014-05-27 10:53:31 +0000</bug_when>
    <thetext>Further idea, based on discussion at: http://krijnhoetmer.nl/irc-logs/whatwg/20140527#l-237

If the origin that is making a request to localhost (or any other explicitly local address) is itself one that is local (either explicitly or because its domain maps to loopback) then that request is subject to the usual processing, CORS and all.

If however that origin maps to any other IP, access to explicit local addresses is just blocked.

This should block the attacks from arbitrary sites, while making it possible for developers to hack things locally without getting unexpected blocking behaviour for localhost.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107246</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-06-04 09:08:28 +0000</bug_when>
    <thetext>Mike, should this be a duplicate of bug 22262? From public-webappsec it seems like this is MIX territory now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107253</commentid>
    <comment_count>6</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2014-06-04 09:55:51 +0000</bug_when>
    <thetext>Yeah, it makes sense to pull this (along with the RFC1918 IP address restrictions) into the mixed content spec. I&apos;m working on that, so I&apos;ll grab this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120902</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-11 09:59:02 +0000</bug_when>
    <thetext>What&apos;s the latest on this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122554</commentid>
    <comment_count>8</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2015-08-11 06:52:33 +0000</bug_when>
    <thetext>(In reply to Anne from comment #7)
&gt; What&apos;s the latest on this?

The latest is that the RFC1918 restrictions got pulled out of MIX because of disagreements, and there&apos;s no good home for them at the moment. I&apos;d still like to make them happen, but WebAppSec wasn&apos;t enthusiastic about going along with me because of IoT concerns and etc.

It&apos;s been on my &quot;nice to do&quot; list for Chrome for months now, but I haven&apos;t made time to understand enough of the network stack&apos;s decision-making process to get the data I need in the places I need it. *shrug*

Status: Pending, I guess.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123320</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-09-26 10:14:18 +0000</bug_when>
    <thetext>Nicholas, it seems like the answer to your question is that you should be wary about relying on this, but that we haven&apos;t really sorted out where that should be specified.

Mike, can we track this issue elsewhere since I&apos;d like to eventually close off Fetch bugs in favor of GitHub and it seems like this is no longer a Fetch issue per se.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123321</commentid>
    <comment_count>10</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2015-09-26 11:15:49 +0000</bug_when>
    <thetext>(In reply to Anne from comment #9)
&gt; Nicholas, it seems like the answer to your question is that you should be
&gt; wary about relying on this, but that we haven&apos;t really sorted out where that
&gt; should be specified.
&gt; 
&gt; Mike, can we track this issue elsewhere since I&apos;d like to eventually close
&gt; off Fetch bugs in favor of GitHub and it seems like this is no longer a
&gt; Fetch issue per se.

Sure. This can live somewhere in w3c/webappsec. There hasn&apos;t been appetite to push this there in the recent past, but I&apos;d like to try again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124516</commentid>
    <comment_count>11</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-01-04 14:38:21 +0000</bug_when>
    <thetext>https://lists.w3.org/Archives/Public/public-webappsec/2016Jan/0000.html
https://mikewest.github.io/cors-rfc1918/

No need to track this here anymore.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>