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.
:computer: Technical Description *
Fix implemented by not allowing to modify object prototype.
:bug: Proof of Concept (PoC) *
Create the following PoC file:
// poc.js
const set = require('ganon/dist/set');
set({}, "__proto__.polluted", true);
console.log({}.polluted);
Execute the following commands in terminal:
npm i ganon # Install affected module
node poc.js # Run the PoC
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/ganon/pull/1 Vulnerability README | https://github.com/418sec/huntr/blob/master/bounties/npm/ganon/1/README.md
User Comments:
:bar_chart: Metadata *
ganon
is vulnerable toPrototype Pollution
.Bounty URL: https://www.huntr.dev/bounties/1-npm-ganon
: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) *
:fire: Proof of Fix (PoF) *
+1 User Acceptance Testing (UAT)