Security fix for Prototype Pollution#1
Conversation
|
👋 Hello, @diogoeichert - @ready-research has opened a PR to us with a fix for a potential vulnerability in your repository. To view the vulnerability, please refer to the bounty URL in the first comment, above. Ultimately, you get to decide if the fix is 👍 or 👎. If you are happy with the fix, please write a new comment ( If you have any questions or need support, come and join us on our community Discord! @diogoeichert & @ready-research - thank you for your efforts in securing the world’s open source code! 🎉 |
|
Hi! Thank you very much for this. While I truly appreciate the collaboration, I must say I don't agree with the solution, specially because I don't see this as a problem this package should try to solve. If the prototype has been polluted already by the time That being said, this change would also break some important functionality currently available, like the creation of multi-inheritance instances, e.g. I have extended the unit tests to cover this case specifically. To run the tests, you can rebase your branch from the main branch and run |
📊 Metadata *
join-assignis vulnerable toPrototype 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-join-assign/
⚙️ 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.
🐛 Proof of Concept (PoC) *
🔥 Proof of Fix (PoF) *
After fix execution will block prototype pollution and polluted will be [undefined.]
👍 User Acceptance Testing (UAT)
After fix functionality is unaffected.