Prototype Pollution
Last updated
Was this helpful?
Last updated
Was this helpful?
Prototype pollution is a JavaScript vulnerability that enables an attacker to add arbitrary properties to global object prototypes, which may then be inherited by user-defined objects.
name.__proto__
, name['__proto__']
, name.constructor.prototype
Steps:
Try different ways of adding an arbitrary property to Object.prototype
.
Try to inject an arbitrary property via the query string, URL fragment, and any JSON input.
(es. __proto__[foo]=bar
-> In console Object.prototype.foo
)
Identify a gadget property that allows you to execute arbitrary JavaScript.
Use and .
More difficult to detect:
No source code access
Lack of developer tools
The DoS problem
Pollution persistence
POST
or PUT
requests that submit JSON data to an application or API are prime candidates
For identifying
For exploit
or