javascript - 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 中执行
解决方案
推荐阅读
- android - 我想在管理员提要数据 Firebase 时向用户发送通知
- python - Keras 2.2:无法加载带有 imagenet 权重的预制模型
- javascript - 如何通过内部html提取dom中的相邻元素
- java - Android/Java:UncaughtExceptionHandler 和 Bugsnag 并行?
- r - 保持一个因子的水平包含另一个因子中的最小水平数
- python - python-Firestore get() 性能问题
- angular - 使用“新 FormControl”处理复选框
- laravel - 如何将自定义表和自定义模型连接到 laravel 的 auth::attempt
- javascript - 使用 Math.floor 方法时出现参考错误(在 chrome 调试器中)
- python - 使用 Python 以编程方式从 .accdb 文件中导出所有表