Navigation Menu

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 Dec 17, 2020
1 parent 6a7767c commit 82ede5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/index.js
Expand Up @@ -13,6 +13,8 @@ var Deffy = require("deffy");
* @return {Object|Array} The field value.
*/
function SetOrGet(input, field, def) {
if (field == '__proto__' || field == 'constructor' || field == 'prototype')
throw new Error('Restricted setting magical attributes')
return input[field] = Deffy(input[field], def);
}

Expand Down

0 comments on commit 82ede5c

Please sign in to comment.