Prototype Pollution in object-path
The object-path library's del() function does not validate which object properties it deletes, allowing an attacker to modify the prototype of Object. This can change default properties like toString on all objects.
mariocasciaro/object-path
Originally disclosed on huntr
object-path is vulnerable to Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'). The del() function fails to validate which Object properties it deletes. This allows attackers to modify the prototype of Object, causing the modification of default properties like toString on all objects.
From the GitHub Advisory Database (GHSA-8v63-cqqc-6r2c, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the del() function does not properly restrict which property paths it processes, allowing deletion or modification of special properties like __proto__ that affect the object prototype.
Impact
Attackers could modify the prototype of Object, causing the modification of default properties like toString on all objects, which may lead to unexpected behaviour or further exploitation.
What the attacker needed
None
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Prototype pollution is a bug where an attacker can add or change properties on a base object that many other objects inherit from. In JavaScript, all objects share a prototype, so changing it can affect every object in the program. Here, a function that deletes properties can be tricked into deleting or altering the prototype itself, which might break things or lead to other attacks.
What is Prototype pollution?
Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.