Skip to content

Commit c006ce9

Browse files
arjunshibuchbrown
authored andcommitted
Fix prototype pollution vulnerability
Closes #76
1 parent 90393f9 commit c006ce9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pointer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ export class Pointer {
6969
for (let i = 1, l = this.tokens.length; i < l; i++) {
7070
parent = value
7171
key = this.tokens[i]
72+
if (key == '__proto__' || key == 'constructor' || key == 'prototype') {
73+
continue
74+
}
7275
// not sure if this the best way to handle non-existant paths...
7376
value = (parent || {})[key]
7477
}

0 commit comments

Comments
 (0)