Skip to content

Commit 67ad7dd

Browse files
alromh87pierreinglebert
authored andcommitted
Fix Prototype Pollution
1 parent f3d6c8e commit 67ad7dd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/apply.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ module.exports = function apply(target, patch) {
1515
var keys = Object.keys(patch);
1616
for (var i = 0; i < keys.length; i++) {
1717
var key = keys[i];
18+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
19+
return target;
20+
}
1821
if (patch[key] === null) {
1922
if (target.hasOwnProperty(key)) {
2023
delete target[key];

0 commit comments

Comments
 (0)