<?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>104305</bug_id>
          
          <creation_ts>2012-12-06 14:27:45 -0800</creation_ts>
          <short_desc>Scripts injected from an isolated world should bypass a page&apos;s CSP</short_desc>
          <delta_ts>2016-03-23 11:31:45 -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>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>97398</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike West">mkwst</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dbates</cc>
    
    <cc>felipe</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>785272</commentid>
    <comment_count>0</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2012-12-06 14:27:45 -0800</bug_when>
    <thetext>Following on from https://bugs.webkit.org/show_bug.cgi?id=97398, it would be nice if inline script blocks injected from an isolated world into the page would run as expected. Not sure it&apos;s easily possible. :(

LastPass, for instance, is a Chrome extension which injects inline scripts to do its thing. Ideally, it wouldn&apos;t do that, but it does.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>785449</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-12-06 17:24:03 -0800</bug_when>
    <thetext>I&apos;d rather than extension authors used scripts from their extension package.  Injecting an inline script is likely to lead to XSS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>785660</commentid>
    <comment_count>2</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2012-12-06 22:54:50 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; I&apos;d rather than extension authors used scripts from their extension package.  Injecting an inline script is likely to lead to XSS.

What about out-of-line scripts hosted on origins that the extension&apos;s CSP allows? I think we&apos;re currently blocking those as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>827713</commentid>
    <comment_count>3</comment_count>
    <who name="Mike West">mkwst</who>
    <bug_when>2013-02-07 11:00:53 -0800</bug_when>
    <thetext>Unassigning myself; let&apos;s be realistic about what I&apos;m actually working on. :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1177394</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2016-03-23 11:09:28 -0700</bug_when>
    <thetext>This issue was resolved with the patch for bug #144830.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1177398</commentid>
    <comment_count>5</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2016-03-23 11:23:05 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; This issue was resolved with the patch for bug #144830.

Disregard this remark. Following the patch for bug #144830 subresource loads/JavaScript execution initiated from markup always honor the Content Security Policy of the page regardless of whether such markup was programmatically inserted into the document from an isolated world. That is, markup injected by an extension is not exempt from the Content Security Policy of the page (programmatic resource fetching, say via XHR, is exempt from CSP when initiated in an isolated world). As of the time of writing, we have not heard of any compatibility issues in Safari extension from this change.

For completeness, the patch for bug #144830 did exempt user agent shadow DOM markup from CSP because such markup is used to implement browser features and is considered an implementation detail.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1177401</commentid>
    <comment_count>6</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2016-03-23 11:31:45 -0700</bug_when>
    <thetext>I marked this issue RESOLVED WONTFIX because I do not feel we should fix this bug as it encourages a bad idiom. I agree with Adam Barth&apos;s remarked in comment #1, we want extension authors to use scripts included in their extension bundle as opposed to programmatically injecting inline script that could make the page susceptible to an XSS vulnerability.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>