<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29183</bug_id>
          
          <creation_ts>2015-10-07 20:06:07 +0000</creation_ts>
          <short_desc>Objects that implement an [Unforgeable] interface should have a non-configurable @@toPrimitive method</short_desc>
          <delta_ts>2016-01-29 01:59:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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>
          
          <blocked>29383</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jason Orendorff">jorendorff</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>allen</cc>
    
    <cc>annevk</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>123598</commentid>
    <comment_count>0</comment_count>
    <who name="Jason Orendorff">jorendorff</who>
    <bug_when>2015-10-07 20:06:07 +0000</bug_when>
    <thetext>There&apos;s a platform security invariant is that `location + &quot;&quot;` must not be spoofable, but ES6 adds a new way to spoof ToPrimitive(obj): it now looks for a method obj[@@toPrimitive].

http://www.ecma-international.org/ecma-262/6.0/index.html#sec-toprimitive

So unless an innocuous @@toPrimitive method is defined as non-configurable and non-writable on the location object itself (not a prototype), `location + &quot;&quot;` can be spoofed by defining a custom @@toPrimitive method on it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123600</commentid>
    <comment_count>1</comment_count>
    <who name="Allen Wirfs-Brock">allen</who>
    <bug_when>2015-10-07 20:59:16 +0000</bug_when>
    <thetext>Note that it is sufficent to define a non-configurable, readonly own data property whose value is undefined</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123707</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2015-10-14 13:12:57 +0000</bug_when>
    <thetext>Non-configurable, readonly data property with value undefined is what we&apos;re implementing in Gecko.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124739</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-01-29 01:59:26 +0000</bug_when>
    <thetext>Fixed in https://github.com/annevk/html-cross-origin-objects/issues/19. This will move out of IDL and by defined through prose since Location is the only object that needs this.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>