Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Fixed Prototype pollution in simple-deep-assign #1

Merged
merged 1 commit into from
Jan 22, 2021
Merged

Fixed Prototype pollution in simple-deep-assign #1

merged 1 commit into from
Jan 22, 2021

Conversation

d3m0n-r00t
Copy link

@d3m0n-r00t d3m0n-r00t commented Jan 10, 2021

馃搳 Metadata *

Fixed Prototype pollution in simple-deep-assign.

Bounty URL: https://www.huntr.dev/bounties/1-npm-simple-deep-assign

鈿欙笍 Description *

simple-deep-assign is vulnerable to Prototype Pollution.

馃捇 Technical Description *

The package is vulnerable to Prototype pollution in the deepAssgin function. This vulnerability is fixed by filtering the keywords that causes pollution from the object.

馃悰 Proof of Concept (PoC) *

// poc.mjs
import deepAssign from 'simple-deep-assign';

console.log('Before: ', {}.polluted})
deepAssign({}, JSON.parse('{"__proto__": {"polluted": "Prototype Polluted"}}'));
console.log('After: ', {}.polluted})
Before: undefined
After: Prototype Polluted

Screenshot 2021-01-10 155540

馃敟 Proof of Fix (PoF) *

After fix:
Screenshot 2021-01-10 155751

馃憤 User Acceptance Testing (UAT)

All ok.

馃敆 Relates to...

Provide the URL of the PR for the disclosure that this fix relates to.

Copy link

@mzfr mzfr left a comment

Choose a reason for hiding this comment

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

LGTM

@huntr-helper
Copy link
Member

Congratulations d3m0n-r00t - your fix has been selected! 馃帀

Thanks for being part of the community & helping secure the world's open source code.
If you have any questions, please respond in the comments section, or hit us up on Discord. Your bounty is on its way - keep hunting!

Come join us on Discord

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants