Skip to content

Commit 3f17eb1

Browse files
authored
Merge pull request #9 from github/jibrang/fix-prototype-polluting-assignment
Fix prototype polluting assignment
2 parents 688aa81 + 92586fa commit 3f17eb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

target/braintree-1.3.10.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,8 +2366,12 @@ sjcl.random = {
23662366
}
23672367
}
23682368

2369+
const forbiddenKeys = ['__proto__', 'constructor', 'prototype'];
23692370
for (i=0; i<jsTemp.length; i++) {
23702371
j = jsTemp[i];
2372+
if (forbiddenKeys.includes(j)) {
2373+
continue;
2374+
}
23712375
delete cbs[j];
23722376
}
23732377
},

0 commit comments

Comments
 (0)