<?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>173161</bug_id>
          
          <creation_ts>2017-06-09 08:31:43 -0700</creation_ts>
          <short_desc>Webkit rejects requests to localhost from https:// pages</short_desc>
          <delta_ts>2017-06-09 14:13:16 -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>Evangelism</component>
          <version>Safari Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>171934</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="homakov">homakov</reporter>
          <assigned_to name="Jon Davis">jond</assigned_to>
          <cc>jond</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wilander</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1317392</commentid>
    <comment_count>0</comment_count>
    <who name="homakov">homakov</who>
    <bug_when>2017-06-09 08:31:43 -0700</bug_when>
    <thetext>Due to Mixed Content warnings on https pages both mobile and desktop Safari reject access to http://127.0.0.1 and ws://127.0.0.1 which are localhost and technically not vulnerable to potential MitM attacks - there&apos;s no need to block these requests.

Here is a use case why our project badly needs this access: our app works as an authenticator like U2F that signs specific challenges given by the browser, so the user can log in some website.

When we simply open an app:// from the browser the app does not know who exactly opened it. We found a neat way to transfer unspoofable location.origin to the app: by making a request to localhost server which the app runs. 

Our app has a WebSocket server at localhost:3101 and accepts requests from the browser, then checks Origin header to get trusted origin. It works like a breeze on all other desktop browsers and in Android. Firefox already fixed it in 55: https://bugzilla.mozilla.org/show_bug.cgi?id=1370861

It would be great if Safari could stop the blocking or at worst case allow a preflight request to let websites securely call our app websocket. It&apos;s really the only way for secure site&lt;-&gt;app communication we could find.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1317393</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-06-09 08:31:57 -0700</bug_when>
    <thetext>&lt;rdar://problem/32675155&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1317394</commentid>
    <comment_count>2</comment_count>
    <who name="homakov">homakov</who>
    <bug_when>2017-06-09 08:32:17 -0700</bug_when>
    <thetext>CC</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1317622</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-06-09 14:13:16 -0700</bug_when>
    <thetext>As discussed in the original, I do not think that this is a valid use case for a web browser, and should be prevented even more strictly.

*** This bug has been marked as a duplicate of bug 171934 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>