Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Prototype pollution fix
Browse files Browse the repository at this point in the history
  • Loading branch information
d3m0n-r00t committed Jan 10, 2021
1 parent fb360e6 commit fd3d818
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simpleDeepAssign.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ function isObject(item/*: any*/)/*: boolean*/ {
*/
function deepAssignObject(target/*: Object*/, source/*: Object*/)/*: void*/ {
Object.keys(source).forEach(key => {
if (key === '__proto__' || key === 'prototype' || key === 'constructor'){
return;
}
if (isObject(target[key]) && isObject(source[key])) {
deepAssignObject(target[key], source[key]);
return;
Expand Down

0 comments on commit fd3d818

Please sign in to comment.