Skip to content

Commit 5a7c5b8

Browse files
MatthiasKunnentimoxley
authored andcommitted
Fix prototype pollution on unflatten
Fixes #105.
1 parent 6ed45bb commit 5a7c5b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ function unflatten (target, opts) {
7777
var recipient = result
7878

7979
while (key2 !== undefined) {
80+
if (key1 === '__proto__') {
81+
return
82+
}
8083
var type = Object.prototype.toString.call(recipient[key1])
8184
var isobject = (
8285
type === '[object Object]' ||

0 commit comments

Comments
 (0)