Skip to content

Commit

Permalink
fixed prototype pollution (#418)
Browse files Browse the repository at this point in the history
Co-authored-by: Asjid Kalam <asjid.kalam@gmail.com>
Co-authored-by: Jamie Slome <jamie@418sec.com>
  • Loading branch information
3 people committed Sep 3, 2020
1 parent 3f14dc5 commit f2868ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/php/strings/parse_str.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ module.exports = function parse_str (str, array) { // eslint-disable-line camelc
key = _fixStr(tmp[0])
value = (tmp.length < 2) ? '' : _fixStr(tmp[1])

if (key.includes('__proto__') || key.includes('constructor') || key.includes('prototype')) {
break;
}

while (key.charAt(0) === ' ') {
key = key.slice(1)
}
Expand Down

0 comments on commit f2868ae

Please sign in to comment.