<?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>153160</bug_id>
          
          <creation_ts>2016-01-15 15:12:39 -0800</creation_ts>
          <short_desc>CSP: Don&apos;t inherit parent&apos;s CSP in PluginDocuments</short_desc>
          <delta_ts>2022-10-20 09:40:53 -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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BlinkMergeCandidate, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Bates">dbates</reporter>
          <assigned_to name="Daniel Bates">dbates</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>rreno</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1155982</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2016-01-15 15:12:39 -0800</bug_when>
    <thetext>We should merge &lt;https://src.chromium.org/viewvc/blink?view=rev&amp;revision=191037&gt;.

Don&apos;t inherit parent&apos;s CSP in PluginDocuments

Inheriting the CSP in a PluginDocument causes &lt;iframe src=&quot;foo.pdf&quot;&gt; to
be blocked if the parent&apos;s CSP forbids &lt;embed src=&quot;foo.pdf&quot;&gt;, as the
iframe turns into a PluginDocument with an &lt;embed&gt; tag inside it.

The only exception is that the plugin-types directive is still inherited from a parent document to a child PluginDocument, which preserves the current behavior and is required by the CSP spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1159615</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-01-27 20:49:05 -0800</bug_when>
    <thetext>&lt;rdar://problem/24383285&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1907075</commentid>
    <comment_count>2</comment_count>
    <who name="Ryan Reno">rreno</who>
    <bug_when>2022-10-20 09:35:35 -0700</bug_when>
    <thetext>I can&apos;t reproduce the bug this Blink revision fixed.

index.html:
-----------
&lt;!DOCTYPE html&gt;
&lt;iframe src=&quot;plugin-test.html&quot;&gt;&lt;/iframe&gt;

plugin-test.html:
----------------
&lt;!DOCTYPE html&gt;
&lt;meta http-equiv=&quot;Content-Security-Policy&quot; content=&quot;object-src &apos;none&apos;&quot;&gt;
&lt;iframe src=&quot;foo.pdf&quot;&gt;&lt;/iframe&gt;

The above example displays the PDF as expected.

Another attempt I made was to simulate what the tests in that revision simulated with a python server which responds to any GET request with

Content-Type: application/x-webkit-netscape-test
Content-Security-Policy: object-src &apos;none&apos;

&lt;h2&gt;test&lt;/h2&gt;

This causes WebKit to initiate a download of a plain text file containing the text &quot;test&quot;

At no point does CSP block anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1907077</commentid>
    <comment_count>3</comment_count>
    <who name="Ryan Reno">rreno</who>
    <bug_when>2022-10-20 09:39:50 -0700</bug_when>
    <thetext>Additionally, this example also displays the PDF as expected.

&lt;!DOCTYPE html&gt;
&lt;meta http-equiv=&quot;Content-Security-Policy&quot; content=&quot;object-src &apos;none&apos;&quot;&gt;
&lt;iframe src=&quot;foo.pdf&quot;&gt;&lt;/iframe&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1907078</commentid>
    <comment_count>4</comment_count>
    <who name="Ryan Reno">rreno</who>
    <bug_when>2022-10-20 09:40:53 -0700</bug_when>
    <thetext>(In reply to Ryan Reno from comment #3)
&gt; Additionally, this example also displays the PDF as expected.
&gt; 
&gt; &lt;!DOCTYPE html&gt;
&gt; &lt;meta http-equiv=&quot;Content-Security-Policy&quot; content=&quot;object-src &apos;none&apos;&quot;&gt;
&gt; &lt;iframe src=&quot;foo.pdf&quot;&gt;&lt;/iframe&gt;

actually I don&apos;t know if that&apos;s expected or not? Maybe that&apos;s a separate issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>