Skip to content

Commit

Permalink
chore(config): guard against prototype pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Feb 28, 2024
1 parent 93cb6eb commit 3a17432
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Config {

function applyDefaults(cfg = {}, defaults = {}) {
for (const d in defaults) {
if (d === "__proto__" || d === "constructor") continue;
if ([undefined, null].includes(cfg[d])) {
cfg[d] = defaults[d]
} else if (typeof cfg[d] === 'object' && typeof defaults[d] === 'object') {
Expand Down

0 comments on commit 3a17432

Please sign in to comment.