Skip to content

Commit dc17a2e

Browse files
authored
Merge pull request #384 from 418sec/1-npm-convict
Security Fix for Prototype Pollution - huntr.dev
2 parents 95f4ab3 + 180d692 commit dc17a2e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/convict/src/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,10 @@ const convict = function convict(def, opts) {
561561
const path = k.split('.')
562562
const childKey = path.pop()
563563
const parentKey = path.join('.')
564-
const parent = walk(this._instance, parentKey, true)
565-
parent[childKey] = v
564+
if (!(parentKey == '__proto__' || parentKey == 'constructor' || parentKey == 'prototype')) {
565+
const parent = walk(this._instance, parentKey, true)
566+
parent[childKey] = v
567+
}
566568
return this
567569
},
568570

0 commit comments

Comments
 (0)