<?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>16848</bug_id>
          
          <creation_ts>2008-01-11 18:19:54 -0800</creation_ts>
          <short_desc>SecurityOrigin::copy does not copy m_domainWasSetInDOM</short_desc>
          <delta_ts>2008-04-26 19:01:42 -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>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.4</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="Adam Barth">abarth</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>beidson</cc>
    
    <cc>collinj</cc>
    
    <cc>mjs</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66986</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-01-11 18:19:54 -0800</bug_when>
    <thetext>The new SecurityOrigin::copy method does not copy m_domainWasSetInDOM when making a copy of the security origin.  This does not appear to be exploitable currently, but could lead to two classes of bugs:

1) A document sets its document.domain and then tries to access an object that uses a copy() of its SecurityOrigin.  It can not access the document because that document&apos;s origin has forgotten that it had set its domain property.

2) A malicious document from foo.example.com could set its document.domain property to example.com, then transfer control to an object that uses a copy() of its security origin.  Once there, it could script example.com.

The copy() method also does not copy m_noAccess, which could lead to similar attacks using data: URLs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66988</commentid>
    <comment_count>1</comment_count>
      <attachid>18402</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-01-11 18:21:22 -0800</bug_when>
    <thetext>Created attachment 18402
Fixes SecurityOrigin::copy method to copy the security origin

This patch fixes the SecurityOrigin::copy method to copy the security origin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66991</commentid>
    <comment_count>2</comment_count>
      <attachid>18402</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-01-11 18:35:05 -0800</bug_when>
    <thetext>Comment on attachment 18402
Fixes SecurityOrigin::copy method to copy the security origin

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67143</commentid>
    <comment_count>3</comment_count>
      <attachid>18402</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-01-13 12:22:47 -0800</bug_when>
    <thetext>Comment on attachment 18402
Fixes SecurityOrigin::copy method to copy the security origin

After further scrutiny, there&apos;s another aspect of this patch that I&apos;m not sure about.

This removes the copy() calls on the protocol and host. Under normal circumstances, copy() is not needed to copy a WebCore::String, but if we intend to use the string on another thread, we do need a copy(). I&apos;m not sure it&apos;s safe to remove the copy() here, because I suspect that the caller does use this on another thread.

We either need to prove those copies aren&apos;t needed, or create a new version of this patch that retains the calls to copy().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67261</commentid>
    <comment_count>4</comment_count>
      <attachid>18450</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2008-01-14 17:16:02 -0800</bug_when>
    <thetext>Created attachment 18450
Makes SecurityOriing::copy make a deep copy of SecurityOrigin

Here&apos;s an updated version of the patch that makes a deep copy.  I don&apos;t know if the SecurityOrigin::copy method is needed, but it&apos;s probably a good idea to actually have it make a copy or remove it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79014</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-04-26 19:01:42 -0700</bug_when>
    <thetext>Fixed in r32597.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>18402</attachid>
            <date>2008-01-11 18:21:22 -0800</date>
            <delta_ts>2008-01-14 17:16:02 -0800</delta_ts>
            <desc>Fixes SecurityOrigin::copy method to copy the security origin</desc>
            <filename>security-origin-copy.patch</filename>
            <type>text/plain</type>
            <size>2071</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAyOTQyMikKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTQgQEAKKzIwMDgtMDEtMTEgIEFkYW0gQmFydGggIDxoazk1NjVAZ21haWwuY29t
PgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEZpeGVk
IFNlY3VyaXR5T3JpZ2luOjpjb3B5IHRvIGNvcHkgc2VjdXJpdHkgb3JpZ2luLgorCisgICAgICAg
ICogcGxhdGZvcm0vU2VjdXJpdHlPcmlnaW4uY3BwOgorICAgICAgICAoV2ViQ29yZTo6U2VjdXJp
dHlPcmlnaW46OlNlY3VyaXR5T3JpZ2luKToKKyAgICAgICAgKFdlYkNvcmU6OlNlY3VyaXR5T3Jp
Z2luOjpjb3B5KToKKyAgICAgICAgKiBwbGF0Zm9ybS9TZWN1cml0eU9yaWdpbi5oOgorCiAyMDA4
LTAxLTExICBDaHJpc3RpYW4gRHl3YW4gIDxjaHJpc3RpYW5AaW1lbmRpby5jb20+CiAKICAgICAg
ICAgUmV2aWV3ZWQgYnkgQW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JlYXRlKG1fcHJvdG9jb2wuY29weSgp
LCBtX2hvc3QuY29weSgpLCBtX3BvcnQsIDApOworICAgIHJldHVybiBuZXcgU2VjdXJpdHlPcmln
aW4oKnRoaXMpOwogfQogCi0KIHZvaWQgU2VjdXJpdHlPcmlnaW46OnNldERvbWFpbkZyb21ET00o
Y29uc3QgU3RyaW5nJiBuZXdEb21haW4pCiB7CiAgICAgbV9kb21haW5XYXNTZXRJbkRPTSA9IHRy
dWU7CkluZGV4OiBXZWJDb3JlL3BsYXRmb3JtL1NlY3VyaXR5T3JpZ2luLmgKPT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQot
LS0gV2ViQ29yZS9wbGF0Zm9ybS9TZWN1cml0eU9yaWdpbi5oCShyZXZpc2lvbiAyOTQyMikKKysr
IFdlYkNvcmUvcGxhdGZvcm0vU2VjdXJpdHlPcmlnaW4uaAkod29ya2luZyBjb3B5KQpAQCAtNjUs
NiArNjUsNyBAQCBuYW1lc3BhY2UgV2ViQ29yZSB7CiAgICAgICAgIAogICAgIHByaXZhdGU6CiAg
ICAgICAgIFNlY3VyaXR5T3JpZ2luKGNvbnN0IFN0cmluZyYgcHJvdG9jb2wsIGNvbnN0IFN0cmlu
ZyYgaG9zdCwgdW5zaWduZWQgc2hvcnQgcG9ydCk7CisgICAgICAgIFNlY3VyaXR5T3JpZ2luKGNv
bnN0IFNlY3VyaXR5T3JpZ2luJik7CiAKICAgICAgICAgU3RyaW5nIG1fcHJvdG9jb2w7CiAgICAg
ICAgIFN0cmluZyBtX2hvc3Q7Cg==
</data>
<flag name="review"
          id="8038"
          type_id="1"
          status="-"
          setter="darin"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>18450</attachid>
            <date>2008-01-14 17:16:02 -0800</date>
            <delta_ts>2008-01-14 17:16:02 -0800</delta_ts>
            <desc>Makes SecurityOriing::copy make a deep copy of SecurityOrigin</desc>
            <filename>origin-copy-2007-01-14.patch</filename>
            <type>text/plain</type>
            <size>2052</size>
            <attacher name="Adam Barth">abarth</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAyOTQ4MSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTQgQEAKKzIwMDgtMDEtMTQgIEFkYW0gQmFydGggIDxoazk1NjVAZ21haWwuY29t
PgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEZpeGVk
IFNlY3VyaXR5T3JpZ2luOjpjb3B5IHRvIGNvcHkgc2VjdXJpdHkgb3JpZ2luLgorCisgICAgICAg
ICogcGxhdGZvcm0vU2VjdXJpdHlPcmlnaW4uY3BwOgorICAgICAgICAoV2ViQ29yZTo6U2VjdXJp
dHlPcmlnaW46OlNlY3VyaXR5T3JpZ2luKToKKyAgICAgICAgKFdlYkNvcmU6OlNlY3VyaXR5T3Jp
Z2luOjpjb3B5KToKKyAgICAgICAgKiBwbGF0Zm9ybS9TZWN1cml0eU9yaWdpbi5oOgorCiAyMDA4
LTAxLTE0ICBEYXJpbiBBZGxlciAgPGRhcmluQGFwcGxlLmNvbT4KIAogICAgICAgICBSZXZpZXdl
ZCBieSBTYW0uCkluZGV4OiBXZWJDb3JlL3BsYXRmb3JtL1NlY3VyaXR5T3JpZ2luLmNwcAo9PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09Ci0tLSBXZWJDb3JlL3BsYXRmb3JtL1NlY3VyaXR5T3JpZ2luLmNwcAkocmV2aXNpb24g
Mjk0ODEpCisrK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c1NldEluRE9NID0gdHJ1ZTsKSW5kZXg6IFdlYkNvcmUv
cGxhdGZvcm0vU2VjdXJpdHlPcmlnaW4uaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBXZWJDb3JlL3BsYXRmb3Jt
L1NlY3VyaXR5T3JpZ2luLmgJKHJldmlzaW9uIDI5NDgxKQorKysgV2ViQ29yZS9wbGF0Zm9ybS9T
ZWN1cml0eU9yaWdpbi5oCSh3b3JraW5nIGNvcHkpCkBAIC02NSw2ICs2NSw3IEBAIG5hbWVzcGFj
ZSBXZWJDb3JlIHsKICAgICAgICAgCiAgICAgcHJpdmF0ZToKICAgICAgICAgU2VjdXJpdHlPcmln
aW4oY29uc3QgU3RyaW5nJiBwcm90b2NvbCwgY29uc3QgU3RyaW5nJiBob3N0LCB1bnNpZ25lZCBz
aG9ydCBwb3J0KTsKKyAgICAgICAgU2VjdXJpdHlPcmlnaW4oY29uc3QgU2VjdXJpdHlPcmlnaW4m
KTsKIAogICAgICAgICBTdHJpbmcgbV9wcm90b2NvbDsKICAgICAgICAgU3RyaW5nIG1faG9zdDsK
</data>

          </attachment>
      

    </bug>

</bugzilla>