Skip to content

Commit c92d145

Browse files
committed
fix: prevent prototype pollution in set
1 parent 66573b4 commit c92d145

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/set.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function addValue(data, key, value) {
5151
const property = key.match(findProperty)?.pop() ?? key;
5252
if (key === "[]" && Array.isArray(data)) {
5353
data.push(value);
54-
} else {
54+
} else if (!accessToPrototype(property, data)) {
5555
data[property] = value;
5656
}
5757
}

0 commit comments

Comments
 (0)