Skip to content

Commit acddf25

Browse files
Fix code scanning alert no. 2: Prototype-polluting function (#712)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 1c752e0 commit acddf25

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/mergeDeep.js

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ class MergeDeep {
9191
// One of the oddities is when we compare objects, we are only interested in the properties of source
9292
// So any property in the target that is not in the source is not treated as a deletion
9393
for (const key in source) {
94+
// Skip prototype pollution vectors
95+
if (key === "__proto__" || key === "constructor") {
96+
continue;
97+
}
9498
// Logic specific for Github
9599
// API response includes urls for resources, or other ignorable fields; we can ignore them
96100
if (key.indexOf('url') >= 0 || this.ignorableFields.indexOf(key) >= 0) {

0 commit comments

Comments
 (0)