Skip to content

Commit 20ef0ef

Browse files
MatthiasKunnentimoxley
authored andcommitted
Fix prototype pollution on unflatten
Fixes #105.
1 parent e8fb281 commit 20ef0ef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

+4
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ function unflatten (target, opts) {
116116
let recipient = result
117117

118118
while (key2 !== undefined) {
119+
if (key1 === '__proto__') {
120+
return
121+
}
122+
119123
const type = Object.prototype.toString.call(recipient[key1])
120124
const isobject = (
121125
type === '[object Object]' ||

0 commit comments

Comments
 (0)