Node.js third-party modules: Prototype pollution attack in node.extend

ID H1:430831
Type hackerone
Reporter asgerf
Modified 2018-11-30T14:01:57


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.extend version: 2.0.0 npm page:

Module Description

A port of jQuery.extend that actually works on node.js

Module Stats

267,701 downloads in the last week


Vulnerability Description

This is a variant of this vulnerability:

node.extend can be tricked into adding or modifying properties of the Object prototype. These properties will be present on all objects.

Steps To Reproduce:

Craft an object of form {__proto__: {...}} and send it to node.extend: javascript let extend = require('node.extend'); extend(true, {}, JSON.parse('{"__proto__": {"isAdmin": true}}')); console.log({}.isAdmin); // true

Wrap up

  • I contacted the maintainer to let them know: [N]
  • I opened an issue in the related repository: [N]


Denial of service, possibly more depending on the application. See