https://huntr.dev/users/alromh87 has fixed the Prototype Pollution vulnerability 🔨. alromh87 has been awarded $25 for fixing the vulnerability through the huntr bug bounty program 💵. Think you could fix a vulnerability like this?
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) *
Install the package(npm i licia), run the below code:
safeSet
var licia = require('licia');
var src = {};
licia.safeSet(src, "__proto__.polluted", "pwned!");
console.log(polluted);
Outputs pwned!.
extendDeep
var utils = require('licia');
var src = {};
let object = utils.extendDeep({}, JSON.parse('{ "myProperty": "a", "prototype" : { "isAdmin" : true } }'));
console.log(object.prototype.isAdmin);
Outputs true
🔥 Proof of Fix (PoF) *
After fix polluted is not defined and prototype is unafected
https://huntr.dev/users/alromh87 has fixed the Prototype Pollution vulnerability 🔨. alromh87 has been awarded $25 for fixing the vulnerability through the huntr bug bounty program 💵. 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/licia/pull/1 Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/licia/1/README.md
User Comments:
📊 Metadata *
licia is a useful utility collection with zero dependencies used in nodejs. safeSet in this package is vulnerable to prototype pollution.
Bounty URL: https://www.huntr.dev/bounties/1-npm-licia
⚙️ 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) *
safeSet
Outputs pwned!.
extendDeep
Outputs true
🔥 Proof of Fix (PoF) *
After fix polluted is not defined and prototype is unafected
👍 User Acceptance Testing (UAT)
After fix functionality is unafected