Skip to content

Commit

Permalink
Security Fix for Prototype Pollution
Browse files Browse the repository at this point in the history
Fixing the issues in set() and deepFillIn()
  • Loading branch information
ready-research committed Sep 5, 2021
1 parent 46a319d commit 44d6965
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const mkdirP = function (object, path) {
}
const parts = path.split('.')
parts.forEach(function (key) {
if (isPrototypePolluted(key)) return
if (!object[key]) {
object[key] = {}
}
Expand Down Expand Up @@ -419,6 +420,7 @@ const utils = {
deepFillIn (dest, source) {
if (source) {
utils.forOwn(source, function (value, key) {
if (isPrototypePolluted(key)) return
const existing = dest[key]
if (isPlainObject(value) && isPlainObject(existing)) {
utils.deepFillIn(existing, value)
Expand Down

0 comments on commit 44d6965

Please sign in to comment.