-
Notifications
You must be signed in to change notification settings - Fork 73
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
Security Fix for Prototype Pollution - huntr.dev #121
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Security Fix for Prototype Pollution in mquery
vkarpov15
approved these changes
Mar 29, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
Just to alleviate concerned readers, this does not affect Mongoose, Mongoose has its own mergeClone()
that was fixed in Automattic/mongoose@22ad62a
vkarpov15
added a commit
to Automattic/mongoose
that referenced
this pull request
Mar 29, 2021
This was referenced Mar 31, 2021
This was referenced Feb 17, 2023
This was referenced Apr 3, 2023
This was referenced May 9, 2023
This was referenced Dec 4, 2023
This was referenced Dec 16, 2023
Closed
This was referenced Dec 29, 2023
Closed
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@zpbrent (https://huntr.dev/users/zpbrent) has fixed a potential Prototype Pollution vulnerability in your repository 🔨. For more information, visit our website (https://huntr.dev/) or click the bounty URL below...
Q | A
Version Affected | *
Bug Fix | YES
Original Pull Request | 418sec#1
If you are happy with this disclosure, we would love to get a CVE assigned to the vulnerability. Feel free to credit @zpbrent, the discloser found in the bounty URL (below) and @huntr-helper.
User Comments:
📊 Metadata *
mquery is aware of the risk of prototype pollution in its exported functions
cloneObject()
andmerge()
and readily present protection by checking the key invar specialProperties = ['__proto__', 'constructor', 'prototype']
. However, the current protection misses to protect another exported functionmergeClone()
. As a result, the latest version 3.2.4 is still vulnerable to prototype pollution.Bounty URL: https://www.huntr.dev/bounties/1-npm-mquery/
⚙️ Description *
Filter out
specialProperties = ['__proto__', 'constructor', 'prototype']
.💻 Technical Description *
Place the protection code in
mergeClone()
:if (specialProperties.indexOf(key) !== -1) { continue; }
🐛 Proof of Concept (PoC) *
🔥 Proof of Fix (PoF) *
👍 User Acceptance Testing (UAT)
N/A
🔗 Relates to...
https://www.huntr.dev/bounties/1-npm-mquery/