eas*_*asa 1 javascript security this
我想知道以下函数如何设置'this'元素并获取数组单元格?请.
//my secure code
var priv = ['item-0','item-1'];
var api = {push: function(x){priv.push(x)}}
api.store = function(i,x){priv[i] = x}
//the attaker script
var result;
api.store('push',function(){result = this[0]});
api.push();
//the result is cell 0 of private array
//how?
//if i change the 'push' parameter then the result is empty!
document.write(result)Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
86 次 |
| 最近记录: |