Closed huntr-helper closed 3 years ago
@Yomguithereal, if you want more security fixes and patches like this in the future, you can let security researchers know that they can win bounties protecting your repository by copying this small code snippet into your README.md:
[![huntr](https://cdn.huntr.dev/huntr_security_badge.svg)](https://huntr.dev)
👇 👇 👇
@arjunshibu (https://huntr.dev/users/arjunshibu) 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 | https://github.com/418sec/baobab/pull/1 Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/baobab/1/README.md
User Comments:
:bar_chart: Metadata *
baobab
is vulnerable toPrototype Pollution
.Bounty URL: https://www.huntr.dev/bounties/1-npm-baobab
:gear: 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
andprototype
. 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.:computer: Technical Description *
Fix implemented by not allowing to modify object prototype.
:bug: Proof of Concept (PoC) *
console.log(
Before: ${{}.polluted}
) tree = new Baobab() tree.deepMerge(JSON.parse('{"proto": {"polluted": true}}')) console.log(After: ${{}.polluted}
):fire: Proof of Fix (PoF) *
I've added unit tests for Prototype Pollution
+1 User Acceptance Testing (UAT)