NodeJS - __proto__ & prototype Pollution
JavaScript中的对象
// Run this in the developers tools console
console.log(Object.create(null)); // This will output an empty object.JavaScript中的函数和类
// Run this in the developers tools console
function Employee(name, position) {
this.name = name;
this.position = position;
this.introduce = function() {
return "My name is " + this.name + " and I work as a " + this.position + ".";
}
}
Employee.prototype
var employee1 = new Employee("Generic Employee", "Developer");
employee1.__proto__JavaScript中的原型
继承
__proto__污染
探索JavaScript中的原型污染
原型污染
污染其他对象
从类到Object.prototype
数组元素污染
Html元素污染
例子
基本示例
覆盖函数
Proto污染到RCE
Prototype Pollution to RCE客户端原型污染到XSS
Client Side Prototype PollutionCVE-2019–11358:通过jQuery $ .extend进行原型污染攻击
CVE-2018-3721,CVE-2019-10744:通过lodash进行原型污染攻击
具有CVE的另一个教程
用于检测原型污染的工具
NodeJS中的AST原型污染
Handlebars漏洞分析
Pug漏洞
预防措施
参考资料
最后更新于