Skip to content

Commit

Permalink
fix: πŸ› fix prototype pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamGold committed Aug 25, 2020
1 parent a123018 commit 21a9046
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ function parsePath(path) {
var str = path.replace(/([^\\])\[/g, '$1.[');
var parts = str.match(/(\\\.|[^.]+?)+/g);
return parts.map(function mapMatches(value) {
if (value === "constructor" || value === "__proto__" || value === "prototype") {
return {}
}
var regexp = /^\[(\d+)\]$/;
var mArr = regexp.exec(value);
var parsed = null;
Expand Down

0 comments on commit 21a9046

Please sign in to comment.