Closed huntr-helper closed 2 years ago
@chbrown - let me know if you have any thoughts or questions, cheers! 🍰
@chbrown Anything needed to help get this patch merged?
This PR (well, the lack of merge after so long) has gained some fame.
@agnihotriwgu Seems like there's already a fix for the vulnerability we're seeing in Veracode -- just not merged in after close to a year (!). @chbrown is there anything else that needs to be done for this PR?
I was putting this off because I thought there might be a better solution that didn't just skip over these polluting keys but didn't throw an error outright... but I couldn't summon the persistence (interest) to find it.
I still don't know why this "vulnerability" is such a big deal but I figure the behavior is broken either way, so if c006ce9 assuages some fears out there, sure, why not.
Re: "anything else that needs to be done for this PR?" — it wasn't that hard to cherry-pick out the right commit and assimilate it, but for the record:
key == '__proto__' || key == 'constructor' || key == 'prototype'
is 4x faster than ['__proto__', 'constructor', 'prototype'].includes(key)
which is about what I would have guessed.Anyhow, fixed in v5.0.0. See https://github.com/chbrown/rfc6902#changelog.
Thanks for resolving this @chbrown!
https://huntr.dev/users/arjunshibu 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 | https://github.com/418sec/rfc6902/pull/1 Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/rfc6902/1/README.md
User Comments:
📊 Metadata *
rfc6902
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-rfc6902
⚙️ 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 *
Fix implemented by not allowing to modify object prototype.
🐛 Proof of Concept (PoC) *
🔥 Proof of Fix (PoF) *
Prototype pollution is fixed as seen below.
👍 User Acceptance Testing (UAT)