<?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>218980</bug_id>
          
          <creation_ts>2020-11-16 05:53:59 -0800</creation_ts>
          <short_desc>Treat loopback addresses (127.0.0.0/8, ::1/128, localhost, .localhost) as potentially trustworthy URL</short_desc>
          <delta_ts>2024-10-09 19:10:21 -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>Page Loading</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=254991</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=232088</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=281149</see_also>
          <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>
          <dependson>218623</dependson>
    
    <dependson>218627</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Frédéric Wang Nélar">fred.wang</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>beidson</cc>
    
    <cc>gsnedders</cc>
    
    <cc>jfernandez</cc>
    
    <cc>julian.fortune</cc>
    
    <cc>kevin.flanagan</cc>
    
    <cc>lidel</cc>
    
    <cc>me</cc>
    
    <cc>rik</cc>
    
    <cc>smoley</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1707786</commentid>
    <comment_count>0</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2020-11-16 05:53:59 -0800</bug_when>
    <thetext>Preliminary work is done in bug 218623 and bug 218627, but it is including the loopback URLs directly in the definition of &quot;a priori authenticated URL&quot; (https://w3c.github.io/webappsec-mixed-content/#a-priori-authenticated-url) rather than in the one of &quot;potentially trustworthy url&quot; (https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url). This bug is about moving these things around, which might lead to some behavior changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1708066</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-11-16 18:15:56 -0800</bug_when>
    <thetext>&lt;rdar://problem/71468048&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1731474</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-02-19 11:44:42 -0800</bug_when>
    <thetext>https://github.com/WebKit/WebKit/blob/51b6659009f49c33837e1ed10cddbd454315fb44/Source/WebCore/page/SecurityOrigin.cpp#L157 makes it look like we already treat localhost and loopback addresses as potentially trustworthy origins?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1731477</commentid>
    <comment_count>3</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2021-02-19 11:48:09 -0800</bug_when>
    <thetext>(In reply to Sam Sneddon [:gsnedders] from comment #2)
&gt; https://github.com/WebKit/WebKit/blob/
&gt; 51b6659009f49c33837e1ed10cddbd454315fb44/Source/WebCore/page/SecurityOrigin.
&gt; cpp#L157 makes it look like we already treat localhost and loopback
&gt; addresses as potentially trustworthy origins?

IIRC, these functions are confusing since they are actually not used by MixedContentChecker::isMixedContent. See the patches I attached on bug  	218623 and bug 218627 for where we would actually want to plug the new thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1731483</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-02-19 11:55:46 -0800</bug_when>
    <thetext>Right, so there&apos;s the mixed content case, but also the… not-mixed content (lone content?) case for WebIDL&apos;s [SecureContext], for example.

Not totally clear what this specific bug is meant to be for, given the title. Using the SecurityOrigin checks more widely?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1731502</commentid>
    <comment_count>5</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2021-02-19 12:17:21 -0800</bug_when>
    <thetext>(In reply to Sam Sneddon [:gsnedders] from comment #4)
&gt; Right, so there&apos;s the mixed content case, but also the… not-mixed content
&gt; (lone content?) case for WebIDL&apos;s [SecureContext], for example.
&gt; 
&gt; Not totally clear what this specific bug is meant to be for, given the
&gt; title. Using the SecurityOrigin checks more widely?

Yes, so I think I opened this and other related issues in order to address bug 171934 reported by users, which was specifically about mixed content.

I agree that in general it would be good to rely more on this &quot;potentially trustworthy URL&quot; concept when checking whether we are in a secure context. I think this is a bit a mess in browsers &amp; spec currently, the call sites in Chromium are https://github.com/whatwg/html/issues/6369#issuecomment-779212659</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1799332</commentid>
    <comment_count>6</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-10-01 09:15:42 -0700</bug_when>
    <thetext>*** Bug 231035 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1822596</commentid>
    <comment_count>7</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2021-12-10 02:14:02 -0800</bug_when>
    <thetext>Removing myself from assignee since I&apos;m not working on this anymore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2007701</commentid>
    <comment_count>8</comment_count>
    <who name="Julian">julian.fortune</who>
    <bug_when>2024-01-25 14:36:35 -0800</bug_when>
    <thetext>Got tripped up today by WebKit not accepting cookies with `Secure=true` from localhost, while gecko and chromium accepted them no problem.

Would really like to see this fixed, thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>