Skip to content
Permalink
Browse files
[Security] Fix ReDoS (#333)
Fix potential ReDoS
  • Loading branch information
ready-research committed Oct 7, 2021
1 parent 22fe104 commit bf39500712255e9a914a8f90574c11491d1f9cb1
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/util/strip.js
@@ -2,7 +2,7 @@

module.exports = str => {
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('|');

0 comments on commit bf39500

Please sign in to comment.