Skip to content

Commit

Permalink
Fix prototype pollution on unflatten
Browse files Browse the repository at this point in the history
Fixes hughsk#105.
  • Loading branch information
MatthiasKunnen authored and timoxley committed Aug 6, 2020
1 parent 6ed45bb commit 5a7c5b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ function unflatten (target, opts) {
var recipient = result

while (key2 !== undefined) {
if (key1 === '__proto__') {
return
}
var type = Object.prototype.toString.call(recipient[key1])
var isobject = (
type === '[object Object]' ||
Expand Down

0 comments on commit 5a7c5b8

Please sign in to comment.