Skip to content

Commit

Permalink
Merge pull request #1 from arjunshibu/master
Browse files Browse the repository at this point in the history
Security fix for Prototype Pollution vulnerability
  • Loading branch information
huntr.dev | the place to protect open source authored Apr 17, 2021
2 parents ec154c9 + 8f911ab commit 7f6c760
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/util/set-path-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = function setPathValue(obj, path, value) {
let state = obj;
const last = paths[paths.length - 1];
for (let i = 0; i < paths.length - 1; i++) {
state = state && state[paths[i]];
state = state && state[paths[i]] !== Object.prototype && state[paths[i]];
}
if (!state) return false;
if (value !== state[last]) {
Expand Down
2 changes: 1 addition & 1 deletion util/set-path-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = function setPathValue(obj, path, value) {
var state = obj;
var last = paths[paths.length - 1];
for (var i = 0; i < paths.length - 1; i++) {
state = state && state[paths[i]];
state = state && state[paths[i]] !== Object.prototype && state[paths[i]];
}
if (!state) { return false; }
if (value !== state[last]) {
Expand Down

0 comments on commit 7f6c760

Please sign in to comment.