Skip to content

Commit

Permalink
Merge pull request #384 from 418sec/1-npm-convict
Browse files Browse the repository at this point in the history
Security Fix for Prototype Pollution - huntr.dev
  • Loading branch information
dannycoates authored Mar 10, 2021
2 parents 95f4ab3 + 180d692 commit dc17a2e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/convict/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,10 @@ const convict = function convict(def, opts) {
const path = k.split('.')
const childKey = path.pop()
const parentKey = path.join('.')
const parent = walk(this._instance, parentKey, true)
parent[childKey] = v
if (!(parentKey == '__proto__' || parentKey == 'constructor' || parentKey == 'prototype')) {
const parent = walk(this._instance, parentKey, true)
parent[childKey] = v
}
return this
},

Expand Down

0 comments on commit dc17a2e

Please sign in to comment.