Skip to content

Commit

Permalink
Security fix for prototype pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunshibu committed Nov 23, 2020
1 parent 95f4ab3 commit 688c46a
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 688c46a

Please sign in to comment.