Skip to content

Commit

Permalink
Fix prototype pollution vulnerability
Browse files Browse the repository at this point in the history
Closes #76
  • Loading branch information
arjunshibu authored and chbrown committed Dec 16, 2021
1 parent 90393f9 commit c006ce9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export class Pointer {
for (let i = 1, l = this.tokens.length; i < l; i++) {
parent = value
key = this.tokens[i]
if (key == '__proto__' || key == 'constructor' || key == 'prototype') {
continue
}
// not sure if this the best way to handle non-existant paths...
value = (parent || {})[key]
}
Expand Down

0 comments on commit c006ce9

Please # to comment.