Skip to content

Commit 1d655a6

Browse files
committed
Prohibit prototype pollution
1 parent b350b8c commit 1d655a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/functions/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export function setByKeyPath(obj, keyPath, value) {
151151
} else obj[currentKeyPath] = value;
152152
else {
153153
var innerObj = obj[currentKeyPath];
154-
if (!innerObj) innerObj = (obj[currentKeyPath] = {});
154+
if (!innerObj || !hasOwn(obj, currentKeyPath)) innerObj = (obj[currentKeyPath] = {});
155155
setByKeyPath(innerObj, remainingKeyPath, value);
156156
}
157157
} else {

0 commit comments

Comments
 (0)