Skip to content

Commit

Permalink
Fix a ReDoS in 'style' format
Browse files Browse the repository at this point in the history
As there are no `^` or `$` anchors in the regex, this should be equivalent.
Patch deliberately does not change the behavior.
  • Loading branch information
ChALkeR committed Jun 29, 2020
1 parent 9df4acb commit ccde29d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion formats.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports['hostname'] = function (input) {
}
exports['alpha'] = /^[a-zA-Z]+$/
exports['alphanumeric'] = /^[a-zA-Z0-9]+$/
exports['style'] = /\s*(.+?):\s*([^;]+);?/g
exports['style'] = /.:\s*[^;]/g
exports['phone'] = function (input) {
if (!(rePhoneFirstPass.test(input))) return false
if (rePhoneDoubleSpace.test(input)) return false
Expand Down

0 comments on commit ccde29d

Please sign in to comment.