Issue metadata
Sign in to add a comment
|
Security: hasOwnProperty returns unexpected results for local variables
Reported by
nkx...@gmail.com,
Nov 6 2017
|
||||||||||||||||||||||
Issue description
hi, sir:
v8/d8 is falsely exec following code, please have a check:
/*
test starts
this.hasOwnProperty(v02):true
this.hasOwnProperty(v01):false
test ends
*/
try
{
my_print = window.alert;
}
catch(e)
{
my_print = console.log;
}
function f()
{
var v01 = "v01 decl inside f()";
var v02 = undefined;
my_print( 'this.hasOwnProperty(v02):' + this.hasOwnProperty(v02) );
my_print( 'this.hasOwnProperty(v01):' + this.hasOwnProperty(v01) );
}
my_print("test starts");
f();
my_print("test ends");
thanks.
,
Nov 8 2017
I don't think this is security relevant and indeed looks strange. I wouldn't be surprised if this is spec-conform though :-).
,
Nov 8 2017
This is surely working as intended and isn't strange at all. You're just checking whether the global object has the property "undefined" and the property "v01 decl inside f()". And undefined is indeed a property on the global object.
,
Nov 8 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by elawrence@chromium.org
, Nov 8 2017Summary: Security: hasOwnProperty returns unexpected results for local variables (was: Security: falsely exec following code)