-
Notifications
You must be signed in to change notification settings - Fork 654
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 #1654
Conversation
Bump protobuf dep to v3.14.0
grpc-tools: Bump version to 1.10.0
Prototype pollution fix - checking magic attributes - grpc-js
@murgatroid99 @nicolasnoble - let me know if you have any questions or thoughts, here to help! 🍰 |
I want to note that the vulnerability report links above talk about the |
@murgatroid99 - thanks for the clarification, happy to merge and will ensure the discloser is aware as well. Thanks! 🍰 |
@ready-research @d3v53c - just attaching you to make you aware of the above comment... |
https://huntr.dev/users/d3v53c has fixed the Prototype Pollution vulnerability 🔨. Think you could fix a vulnerability like this?
Get involved at https://huntr.dev/
Q | A
Version Affected | ALL
Bug Fix | YES
Original Pull Request | 418sec#3
Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/grpc/1/README.md
User Comments:
📊 Metadata *
grpc is vulnerable to Prototype Pollution. This package allowing for modification of prototype behavior, which may result in Information Disclosure/DoS/RCE.
Bounty URL: https://www.huntr.dev/bounties/1-npm-grpc
⚙️ Description *
Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects.
JavaScript allows all Object attributes to be altered, including their magical attributes such as proto, constructor and prototype.
An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values.
Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain.
💻 Technical Description *
Fixed by avoiding setting magical attributes. The bug is fixed by validating the input strArray to check for prototypes. It is implemented by a simple validation to check for prototype keywords (proto, constructor and prototype), where if it exists, the function returns the object without modifying it, thus fixing the Prototype Pollution Vulnerability.
🐛 Proof of Concept (PoC) *
Create the following PoC file:
// poc.js
var grpc =require('grpc')
grpc.loadPackageDefinition({'constructor.prototype.polluted': { service: "Yes! Its Polluted" }});
console.log({}.polluted)
Execute the following commands in another terminal:
npm i grpc # Install affected module
node poc.js # Run the PoC
Check the Output:
[Function: ServiceClient] { service: 'Yes! Its Polluted' }`
🔥 Proof of Fix (PoF) *
Before:
After:
👍 User Acceptance Testing (UAT)
After fix functionality is unaffected.