Skip to content

Commit ccde29d

Browse files
committed
Fix a ReDoS in 'style' format
As there are no `^` or `$` anchors in the regex, this should be equivalent. Patch deliberately does not change the behavior.
1 parent 9df4acb commit ccde29d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: formats.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ exports['hostname'] = function (input) {
2828
}
2929
exports['alpha'] = /^[a-zA-Z]+$/
3030
exports['alphanumeric'] = /^[a-zA-Z0-9]+$/
31-
exports['style'] = /\s*(.+?):\s*([^;]+);?/g
31+
exports['style'] = /.:\s*[^;]/g
3232
exports['phone'] = function (input) {
3333
if (!(rePhoneFirstPass.test(input))) return false
3434
if (rePhoneDoubleSpace.test(input)) return false

0 commit comments

Comments
 (0)