Skip to content

Commit

Permalink
Fix code scanning alert no. 2: Prototype-polluting function
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
lindluni and github-advanced-security[bot] authored Dec 16, 2024
1 parent 1c752e0 commit e8ad114
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/mergeDeep.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ class MergeDeep {
// One of the oddities is when we compare objects, we are only interested in the properties of source
// So any property in the target that is not in the source is not treated as a deletion
for (const key in source) {
// Skip prototype pollution vectors
if (key === "__proto__" || key === "constructor") {
continue;
}
// Logic specific for Github
// API response includes urls for resources, or other ignorable fields; we can ignore them
if (key.indexOf('url') >= 0 || this.ignorableFields.indexOf(key) >= 0) {
Expand Down

0 comments on commit e8ad114

Please sign in to comment.