<?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>12107</bug_id>
          
          <creation_ts>2007-01-03 18:03:33 -0800</creation_ts>
          <short_desc>Security Regression: Plugins load remote javascript in embedded page&apos;s context</short_desc>
          <delta_ts>2007-03-12 01:21:55 -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>Plug-ins</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://landonf.bikemonkey.org/static/moab-tests/hreftrack.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rosyna">webkit-bugs</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ddkilzer</cc>
    
    <cc>dev+webkit</cc>
    
    <cc>dstorey</cc>
    
    <cc>ggaren</cc>
    
    <cc>KwhiteRight</cc>
    
    <cc>mrowe</cc>
    
    <cc>rachael</cc>
    
    <cc>troyb</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>37257</commentid>
    <comment_count>0</comment_count>
    <who name="Rosyna">webkit-bugs</who>
    <bug_when>2007-01-03 18:03:33 -0800</bug_when>
    <thetext>Look at http://landonf.bikemonkey.org/static/moab-tests/hreftrack.html it shows a dialog on ToT that has the header of &quot;http://landonf.bikemonkey.org&quot; However, the plugin is loading a movie from gnucitizen. The dialog should say http://www.gnucitizen.org/ as the header.

This is NOT a QuickTime bug, this is a WebKit bug as WebKit (well, JavaScriptCore) runs the JavaScript from the plugin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37221</commentid>
    <comment_count>1</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2007-01-03 22:35:22 -0800</bug_when>
    <thetext>Using the latest nightly, I don&apos;t see a dialog.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37203</commentid>
    <comment_count>2</comment_count>
    <who name="Rosyna">webkit-bugs</who>
    <bug_when>2007-01-04 00:17:17 -0800</bug_when>
    <thetext>Occurs for me in ToT. Note, you might have to remove third party QuickTime components (such as those for watching pornography or episodes of torchwood) so the correct handler gets to handle it in the QT plugin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37171</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-04 04:36:34 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Using the latest nightly, I don&apos;t see a dialog.

I am able to see the JavaScript dialog in a locally-built debug build of WebKit r18574 with Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8L127) with QuickTime 7.1.3 installed (with QuickTime Pro registered).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37169</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-04 04:57:58 -0800</bug_when>
    <thetext>Additional browser testing (in no particular order) on my PowerBook G4 with 10.4.8 (8L127):

Firefox 2.0.0.1 shows the JavaScript dialog.
Mac IE 5.2.3 (5815.1) does NOT show the dialog.
OmniWeb 5.5.1 (v607.5) shows the JavaScript dialog.
Opera 9.10 (build 3588) shows the JavaScript dialog AND opens up a new tab with about:blank as the contents.
Mozilla 1.7.13 shows the JavaScript dialog.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37160</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-04 05:00:41 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Using the latest nightly, I don&apos;t see a dialog.

I am able to reproduce this with WebKit nightly r18554 as well with Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8L127).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37167</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-04 06:02:33 -0800</bug_when>
    <thetext>Tracing through WebKit while loading hreftrack.html, I found that [WebPluginController webPlugInContainerLoadRequest:inFrame:] in WebKit/Plugins/WebPluginController.mm appears to be the weak link (where the JavaScript from the QuickTime movie on another site is implicitly trusted and run in the current frame&apos;s context).

I&apos;ve added a FIXME comment below where I think this should happen:

    NSString *JSString = [[request URL] _webkit_scriptIfJavaScriptURL];
    if (JSString) {
        if ([frame findFrameNamed:target] != frame) {
            LOG_ERROR(&quot;JavaScript requests can only be made on the frame that contains the plug-in&quot;);
            return;
        }
        // FIXME: Verify domain of QuickTime (or other) object matches domain of current frame
        [[frame _bridge] stringByEvaluatingJavaScriptFromString:JSString];
    } else {
        if (!request) {
            LOG_ERROR(&quot;could not load URL %@&quot;, [request URL]);
            return;
        }
        [frame _frameLoader]-&gt;load(request, target);
    }
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37151</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-04 06:55:27 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Tracing through WebKit while loading hreftrack.html, I found that
&gt; [WebPluginController webPlugInContainerLoadRequest:inFrame:] in
&gt; WebKit/Plugins/WebPluginController.mm appears to be the weak link (where the
&gt; JavaScript from the QuickTime movie on another site is implicitly trusted and
&gt; run in the current frame&apos;s context).

Unfortunately, I&apos;m not sure if it&apos;s possible for WebKit to &quot;know&quot; where the plug-in content came from since the QuickTime plugin is responsible for loading the content.  As Landon notes in his MOAB #3 blog entry, he had to patch QuickTime plug-in&apos;s nNPN_GetURL() method to do the check.

http://landonf.bikemonkey.org/code/macosx/MOAB_Day_3.20070104063131.4037.zadder.local.html

Of course any plug-in could do the same thing--pull JavaScript from anywhere and pass it to WebKit to execute in the local context.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37149</commentid>
    <comment_count>8</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-04 08:13:40 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; Unfortunately, I&apos;m not sure if it&apos;s possible for WebKit to &quot;know&quot; where the
&gt; plug-in content came from since the QuickTime plugin is responsible for loading
&gt; the content.  As Landon notes in his MOAB #3 blog entry, he had to patch
&gt; QuickTime plug-in&apos;s nNPN_GetURL() method to do the check.

On second thought, if the plug-in is well-behaved (e.g., it doesn&apos;t implement its own URL loader internally), a taint-checking flag (say HasLoadedExternalResources) could be set whenever the plug-in requests a resource outside of the original domain/hostname.  This flag could then be checked before executing any JavaScript from the plug-in.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37148</commentid>
    <comment_count>9</comment_count>
    <who name="David Storey">dstorey</who>
    <bug_when>2007-01-04 09:04:28 -0800</bug_when>
    <thetext>Thanks for CC&apos;ing me.  I&apos;ve reported this as Bug 246168 in out BTS.  I&apos;ll keep you posted with any relevant info from our end.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37138</commentid>
    <comment_count>10</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-04 10:57:21 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Additional browser testing (in no particular order) on my PowerBook G4 with
&gt; 10.4.8 (8L127):

And just for fun on Windows XP SP2 [Version 5.1.2600] with iTunes 7.0.2.16 and QuickTime for Windows 7.1.3:

MSIE 6 (Version 6.0.2900.2180.xpsp_sp2_gdr.050301-1519) shows the JavaScript dialog.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37130</commentid>
    <comment_count>11</comment_count>
    <who name="David Storey">dstorey</who>
    <bug_when>2007-01-04 11:24:59 -0800</bug_when>
    <thetext>After a quick check, we (Opera) seem to have handled this the same way as the currently released Safari in the past, but changed behaviour to how ToT, FF, IE etc handle it as it broke a lot of sites.  We could probably handle things a bit differently though to avoid phishing issues.  </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34598</commentid>
    <comment_count>12</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-01-16 19:35:56 -0800</bug_when>
    <thetext>&lt;rdar://problem/4928683&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25277</commentid>
    <comment_count>13</comment_count>
    <who name="Rosyna">webkit-bugs</who>
    <bug_when>2007-02-07 03:53:41 -0800</bug_when>
    <thetext>The problem isn&apos;t that webkit (or any browser) shows the dialog. The problem (en masse) is the domain the browser says the dialog is from. Many, many Web browsers have labeled the domain in which a dialog comes from after a flaw in the way dialogs was shown was found across browsers.

Due to the labeling, showing a dialog is the easiest way to determine if a browser is susceptible to the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19463</commentid>
    <comment_count>14</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-03-12 01:21:55 -0700</bug_when>
    <thetext>The radar has been marked as Behaves Correctly.  Closing this bug as WONTFIX to reflect that.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>