Skip to content

Commit

Permalink
Merge branch 'luci-m-666-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Clark committed Oct 21, 2020
2 parents 983a133 + 2be9b5f commit 96cf9ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ export function setValueAtPath(target: unknown, val: unknown, path: PathSegments
let p: number;
while (++cursor < len) {
step = path[cursor];
if (step === '__proto__' || step === 'constructor' || step === 'prototype') {
throw new Error('Prototype pollution attempt detected.');
}
if (Array.isArray(it)) {
if (step === '-' && cursor === end) {
it.push(val);
Expand Down

0 comments on commit 96cf9ce

Please sign in to comment.