Skip to content
Permalink
Browse files
[Security]Fix ReDoS (#7)
Fix potential ReDoS
  • Loading branch information
ready-research committed Sep 11, 2021
1 parent 77ac683 commit 78ee15b
Showing 1 changed file with 1 addition and 1 deletion.
@@ -2,7 +2,7 @@

module.exports = function () {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
].join('|');
return new RegExp(pattern, 'g');

0 comments on commit 78ee15b

Please sign in to comment.