eslint-plugin-prototype-pollution-security-rules
Version:
Detect the use of vulnerable features within some libraries from https://github.com/HoLyVieR/prototype-pollution-nsec18/ that are not yet fixed
22 lines (19 loc) • 510 B
JavaScript
/**
* @fileoverview Rule to detect use of deepExtend
* @author Lewis Ardern
*/
;
module.exports = {
create: function (context) {
return {
CallExpression: function (node) {
let args = node.arguments[1];
if ((!args))
return;
if (node.callee.name === 'deepExtend') {
context.report(node, "Use of deepExtend() can lead to Denial-of-Service, For-loop pollution, or Property Injection");
};
}
};
}
};