Skip to content

Commit 2d39249

Browse files
committed
Security fix for Prototype Pollution
1 parent f4ccf0a commit 2d39249

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

unflatten.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ function unflatten(obj = {}) {
1010
let m = {};
1111

1212
while ((m = regex.exec(p))) {
13+
if (curr[prop] === constructor.prototype)
14+
curr[prop] = {}
1315
curr = curr[prop] || (curr[prop] = m[2] ? [] : {});
1416
prop = m[2] || m[1];
1517
}

0 commit comments

Comments
 (0)