Skip to content

Commit

Permalink
Fix the prototype pollution vulnerability found in extend function.
Browse files Browse the repository at this point in the history
Reference: CodeByZach#546
  • Loading branch information
jackfromeast authored Oct 10, 2024
1 parent b163bc0 commit 59b421d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pace.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
source = sources[_i];
if (source) {
for (key in source) {
if (!__hasProp.call(source, key)) continue;
if (!__hasProp.call(source, key) || key === '__proto__' || key === 'constructor' || key === 'prototype') continue;
val = source[key];
if ((out[key] != null) && typeof out[key] === 'object' && (val != null) && typeof val === 'object') {
extend(out[key], val);
Expand Down Expand Up @@ -445,7 +445,7 @@
};

RequestIntercept = (function(_super) {
__extends(RequestIntercept, _super);
__s(RequestIntercept, _super);

function RequestIntercept() {
var monitorXHR,
Expand Down Expand Up @@ -983,4 +983,4 @@
}
}

}).call(this);
}).call(this);

0 comments on commit 59b421d

Please sign in to comment.