> Prototype pollution is a type of vulnerability that occurs in JavaScript when properties of Object.prototype are modified. This is particularly risky because JavaScript objects are dynamic and we can add properties to them at any time. Also, almost all objects in JavaScript inherit from Object.prototype, making it a potential attack vector.
## Summary
* [Tools](#tools)
* [Labs](#labs)
* [Exploit](#exploit)
* [Examples](#examples)
* [Prototype pollution via JSON input](#prototype-pollution-via-json-input)
In JavaScript, prototypes are what allow objects to inherit features from other objects. If an attacker is able to add or modify properties of `Object.prototype`, they can essentially affect all objects that inherit from that prototype, potentially leading to various kinds of security risks.
### Examples
* Imagine that an application uses an object to maintain configuration settings, like this:
```js
let config = {
isAdmin: false
};
```
* An attacker might be able to add an `isAdmin` property to `Object.prototype`, like this:
```js
Object.prototype.isAdmin = true;
```
### Prototype pollution via JSON input
You can access the prototype of any object via the magic property `__proto__`.
* [Server side prototype pollution, how to detect and exploit - YesWeHack](https://blog.yeswehack.com/talent-development/server-side-prototype-pollution-how-to-detect-and-exploit/)