首页 > 解决方案 > Object.constructor.constructor('alert(1)')() 实际上在javascript中做了什么?

问题描述

我参与了应用程序安全,而且我经常使用

 {{constructor.constructor('alert(1)')()}}

在 AngularJS 应用程序中盲目地逃避旧版本中的沙箱。最近我一直在试图理解这到底意味着什么以及它是如何工作的。我尝试阅读对象构造函数并了解对象构造函数指向对象类型。例如。

var a = new String;
console.log(a.constructor);

将打印出来String,如果我这样做a.constructor.constructor将打印出 {}

现在我的问题是如何object.constructor.constructor('ANY FUNCTION HERE')()导致该函数在 javascript 中执行

标签: javascriptangularjswebsecurity

解决方案


推荐阅读