<?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>53440</bug_id>
          
          <creation_ts>2011-01-31 11:12:07 -0800</creation_ts>
          <short_desc>Allow access if security origin access is asked for is the same to the this</short_desc>
          <delta_ts>2011-02-01 12:27:20 -0800</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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="anton muhin">antonm</reporter>
          <assigned_to name="anton muhin">antonm</assigned_to>
          <cc>abarth</cc>
    
    <cc>commit-queue</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>342690</commentid>
    <comment_count>0</comment_count>
    <who name="anton muhin">antonm</who>
    <bug_when>2011-01-31 11:12:07 -0800</bug_when>
    <thetext>Allow access if security origin access is asked for is the same to the this</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342697</commentid>
    <comment_count>1</comment_count>
      <attachid>80664</attachid>
    <who name="anton muhin">antonm</who>
    <bug_when>2011-01-31 11:22:32 -0800</bug_when>
    <thetext>Created attachment 80664
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342701</commentid>
    <comment_count>2</comment_count>
      <attachid>80664</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-01-31 11:24:49 -0800</bug_when>
    <thetext>Comment on attachment 80664
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=80664&amp;action=review

&gt; Source/WebCore/ChangeLog:5
&gt; +        Allow access if security origin access is asked for is the same to the this

&quot;is the same to the this&quot;
=&gt; &quot;is the same as this&quot; ?

&gt; Source/WebCore/ChangeLog:8
&gt; +        Covered by the existing tests.

How is this covered by existing tests if none of the tests changed as a result of this patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342706</commentid>
    <comment_count>3</comment_count>
    <who name="anton muhin">antonm</who>
    <bug_when>2011-01-31 11:29:01 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 80664 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=80664&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:5
&gt; &gt; +        Allow access if security origin access is asked for is the same to the this
&gt; 
&gt; &quot;is the same to the this&quot;
&gt; =&gt; &quot;is the same as this&quot; ?

Done.

&gt; 
&gt; &gt; Source/WebCore/ChangeLog:8
&gt; &gt; +        Covered by the existing tests.
&gt; 
&gt; How is this covered by existing tests if none of the tests changed as a result of this patch?

I mean that nothing started to break with this change.  Does that make sense?  If not, may you suggest how I can reword this phrase?  And I am afraid it&apos;d be pretty much difficult to write a test which will trigger this path right now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342713</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-01-31 11:33:39 -0800</bug_when>
    <thetext>Yeah, I don&apos;t think it&apos;s possible to trigger that branch now.  We should just say that in the ChangeLog.

To give folks reading this bug more context, Anton and I have been discussing adding some defense-in-depth security checks at various points in the bindings.  Those points have SecurityOrigin objects, but not necessarily DOMWindow objects.  Currently, the &quot;you can always access yourself&quot; check is done by comparing DOMWindows.  Adding this branch here is redundant today, but won&apos;t be redundant in the future once we add these extra checks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342733</commentid>
    <comment_count>5</comment_count>
      <attachid>80669</attachid>
    <who name="anton muhin">antonm</who>
    <bug_when>2011-01-31 12:15:17 -0800</bug_when>
    <thetext>Created attachment 80669
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342734</commentid>
    <comment_count>6</comment_count>
    <who name="anton muhin">antonm</who>
    <bug_when>2011-01-31 12:15:54 -0800</bug_when>
    <thetext>Adam, may you have another look?

(In reply to comment #5)
&gt; Created an attachment (id=80669) [details]
&gt; Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342762</commentid>
    <comment_count>7</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2011-01-31 12:47:05 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Yeah, I don&apos;t think it&apos;s possible to trigger that branch now.  We should just say that in the ChangeLog.
&gt; 
&gt; To give folks reading this bug more context, Anton and I have been discussing adding some defense-in-depth security checks at various points in the bindings.  Those points have SecurityOrigin objects, but not necessarily DOMWindow objects.  Currently, the &quot;you can always access yourself&quot; check is done by comparing DOMWindows.  Adding this branch here is redundant today, but won&apos;t be redundant in the future once we add these extra checks.

Can we remove some of the DOMWindow comparing to themselves checks then?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342803</commentid>
    <comment_count>8</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-01-31 14:02:02 -0800</bug_when>
    <thetext>&gt; Can we remove some of the DOMWindow comparing to themselves checks then?

That&apos;s a good idea.  We should be able to remove them after/in this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343141</commentid>
    <comment_count>9</comment_count>
    <who name="anton muhin">antonm</who>
    <bug_when>2011-02-01 04:39:42 -0800</bug_when>
    <thetext>Guys, if you&apos;re fine with this patch, may I ask you to r+ it?

(In reply to comment #8)
&gt; &gt; Can we remove some of the DOMWindow comparing to themselves checks then?
&gt; 
&gt; That&apos;s a good idea.  We should be able to remove them after/in this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343375</commentid>
    <comment_count>10</comment_count>
      <attachid>80669</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-02-01 11:28:16 -0800</bug_when>
    <thetext>Comment on attachment 80669
Patch

Sure.  I think a followup patch to remove the DOMWindow equality comparison might be worth doing too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343380</commentid>
    <comment_count>11</comment_count>
      <attachid>80669</attachid>
    <who name="anton muhin">antonm</who>
    <bug_when>2011-02-01 11:34:35 -0800</bug_when>
    <thetext>Comment on attachment 80669
Patch

Thanks a lot, Adam.  I&apos;ll try to do further cleanup with a separate patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343416</commentid>
    <comment_count>12</comment_count>
      <attachid>80669</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-01 12:27:13 -0800</bug_when>
    <thetext>Comment on attachment 80669
Patch

Clearing flags on attachment: 80669

Committed r77272: &lt;http://trac.webkit.org/changeset/77272&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343417</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-01 12:27:20 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>80664</attachid>
            <date>2011-01-31 11:22:32 -0800</date>
            <delta_ts>2011-01-31 12:15:12 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-53440-20110131222230.patch</filename>
            <type>text/plain</type>
            <size>1253</size>
            <attacher name="anton muhin">antonm</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAyMDk4MmI1NzE0NmZiNzY5MjlkMmVjYWVkY2VhMWRm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5NjhkYmRiMGM4NTU3ZTAyMzI1MDIgMTAwNjQ0Ci0t
LSBhL1NvdXJjZS9XZWJDb3JlL3BhZ2UvU2VjdXJpdHlPcmlnaW4uY3BwCisrKyBiL1NvdXJjZS9X
ZWJDb3JlL3BhZ2UvU2VjdXJpdHlPcmlnaW4uY3BwCkBAIC0xNzgsNiArMTc4LDkgQEAgYm9vbCBT
ZWN1cml0eU9yaWdpbjo6Y2FuQWNjZXNzKGNvbnN0IFNlY3VyaXR5T3JpZ2luKiBvdGhlcikgY29u
c3QKICAgICBpZiAobV91bml2ZXJzYWxBY2Nlc3MpCiAgICAgICAgIHJldHVybiB0cnVlOwogCisg
ICAgaWYgKHRoaXMgPT0gb3RoZXIpCisgICAgICAgIHJldHVybiB0cnVlOworCiAgICAgaWYgKGlz
VW5pcXVlKCkgfHwgb3RoZXItPmlzVW5pcXVlKCkpCiAgICAgICAgIHJldHVybiBmYWxzZTsKIAo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>80669</attachid>
            <date>2011-01-31 12:15:17 -0800</date>
            <delta_ts>2011-02-01 12:27:13 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-53440-20110131231515.patch</filename>
            <type>text/plain</type>
            <size>1250</size>
            <attacher name="anton muhin">antonm</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAyMDk4MmI1NzE0NmZiNzY5MjlkMmVjYWVkY2VhMWRmODRmNTJlYWIxLi5i
ZGE2ZDFjODIxYmVhYjIyMDM2OWU4NjU0MmJkMjgxZjVhMTUxOTJjIDEwMDY0NAotLS0gYS9Tb3Vy
Y2UvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0x
LDMgKzEsMTUgQEAKKzIwM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