Skip to content

Commit

Permalink
glossary: add section on protoype pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Jul 4, 2024
1 parent 89a65ae commit 00390a1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/content/docs/reference/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,21 @@ See the [TC39 glossary][tc39-glossary-primordial-ext] for more information.

## Prototype pollution

TODO
A class of JavaScript vulnerabilities and bugs where a modification is inadvertently made on an object prototype. For example,using unsitized user input for keys, the following:

```
myObj[key] = {};
myObj[key].totallySafe = true;
```

could result in overriding functions on the global `Object` prototype:

```
myObj["__proto__"].totallySafe = val
const uncheckedObj = {};
console.log(uncheckedObj.totallySafe) // true
```


## Realm

Expand Down

0 comments on commit 00390a1

Please sign in to comment.