<?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>196852</bug_id>
          
          <creation_ts>2019-04-11 23:30:11 -0700</creation_ts>
          <short_desc>Unchecked &quot;Prevent cross-site tracking&quot; option behaves incorrectly</short_desc>
          <delta_ts>2024-03-11 09:20:34 -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>WebKit Misc.</component>
          <version>Safari 12</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.13</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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="Remko Tronçon">r+webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wilander</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1526661</commentid>
    <comment_count>0</comment_count>
    <who name="Remko Tronçon">r+webkit</who>
    <bug_when>2019-04-11 23:30:11 -0700</bug_when>
    <thetext>The &quot;Prevent cross-site tracking&quot; option in Safari is either misnamed, or behaves incorrectly when unchecked.

When unchecked, all storage API requests are rejected automatically, so cross-site iframes stop working altogether. 
I was expecting the storage API to always grant storage access with this option unchecked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526806</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-04-12 10:34:10 -0700</bug_when>
    <thetext>&lt;rdar://problem/49855574&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526814</commentid>
    <comment_count>2</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2019-04-12 10:45:28 -0700</bug_when>
    <thetext>Thanks for your bug report. We&apos;ve received at least one similar report before. I agree it should be flipped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526815</commentid>
    <comment_count>3</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2019-04-12 10:46:59 -0700</bug_when>
    <thetext>This said, the third-party resource can always try to set a cookie and read it back to check its status.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526852</commentid>
    <comment_count>4</comment_count>
    <who name="Remko Tronçon">r+webkit</who>
    <bug_when>2019-04-12 11:31:45 -0700</bug_when>
    <thetext>Thanks!

Not sure I understand yet how reading back the cookie can help. You can&apos;t do it pre-storage-access-request, since cookies aren&apos;t guaranteed to work yet (if the 3rd party is classified as tracker); and it&apos;s not supposed to work in the reject handler either (which is where the unchecked option takes you), since cookies won&apos;t work anyway for potentially other reasons (the user explicitly denying access, missing first party interaction, ...)?

I haven&apos;t tested what happens if the 3rd party isn&apos;t classified as a tracker, but we already do the cookie-write-read check in that case to detect the old WebKit behavior where cookies don&apos;t work if the site hasn&apos;t been opened (and used cookies) as first party yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526872</commentid>
    <comment_count>5</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2019-04-12 12:20:35 -0700</bug_when>
    <thetext>(In reply to r+webkit from comment #4)
&gt; Thanks!
&gt; 
&gt; Not sure I understand yet how reading back the cookie can help. You can&apos;t do
&gt; it pre-storage-access-request, since cookies aren&apos;t guaranteed to work yet
&gt; (if the 3rd party is classified as tracker); and it&apos;s not supposed to work
&gt; in the reject handler either (which is where the unchecked option takes
&gt; you), since cookies won&apos;t work anyway for potentially other reasons (the
&gt; user explicitly denying access, missing first party interaction, ...)?
&gt; 
&gt; I haven&apos;t tested what happens if the 3rd party isn&apos;t classified as a
&gt; tracker, but we already do the cookie-write-read check in that case to
&gt; detect the old WebKit behavior where cookies don&apos;t work if the site hasn&apos;t
&gt; been opened (and used cookies) as first party yet.

If ITP is turned off, you can always set cookies. Thus, the third-party who calls hasStorageAccess() can also try to read cookies. If they&apos;re available, there&apos;s no need for calling the Storage Access API. If they&apos;re not, the third-party can try to write a cookie and read it back. If it works, either ITP is turned off or the third-party has not been classified but ITP and has existing cookies that are not exposed in document.cookie, for instance HttpOnly cookies.

The reason I mention cookies not exposed in document.cookie is Safari&apos;s 10+ year old cookie policy where a domain has to set its initial cookie(s) as first-party. Otherwise it cannot use cookies as third-party, regardless of calls to the Storage Access API.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526882</commentid>
    <comment_count>6</comment_count>
    <who name="Remko Tronçon">r+webkit</who>
    <bug_when>2019-04-12 12:55:37 -0700</bug_when>
    <thetext>Ah, I didn&apos;t realize it was just the access API that was rejecting requests, but that storage was still working. Your workaround looks good, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020007</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-03-10 19:49:44 -0700</bug_when>
    <thetext>@Alexey - if it is something need to change on Safari UI level, should we mark this as &quot;RESOLVED MOVED&quot;?

Safari &gt; Settings &gt; Privacy

Website tracking: Prevent cross-site tracking

____

Appreciate if you can share your input.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020140</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2024-03-11 09:20:34 -0700</bug_when>
    <thetext>John would be a better person to answer this. It seems like we are tracking this as a WebKit issue at this point.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>