Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for prototype pollution #1

Merged
merged 2 commits into from Aug 21, 2019
Merged

Fix for prototype pollution #1

merged 2 commits into from Aug 21, 2019

Conversation

rachaelshaw
Copy link
Member

@sailsbot
Copy link

Hi @rachaelshaw! It looks like the title of your pull request doesn’t quite match our guidelines yet. Would you please edit your pull request's title so that it begins with [proposal], [patch], [fixes #<issue number>], [implements #<other PR number>], or [misc]? Once you've edited it, I'll take another look!

@Kirill89
Copy link

Kirill89 commented Aug 20, 2019

👋 I still can reproduce the issue locally with

_.defaultsDeep({}, JSON.parse('{"constructor": {"prototype": {"a0": "polluted!"}}}'));
console.log(({}).a0);

I believe you also need to change line

var value = object[key],
to

var value = safeGet(object, key),

according to https://github.com/lodash/lodash/blob/master/.internal/baseMergeDeep.js#L30

Copy link

@Kirill89 Kirill89 left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants