Skip to content

Commit

Permalink
[Security] Fix ReDoS
Browse files Browse the repository at this point in the history
Fix potential ReDoS
  • Loading branch information
ready-research committed Sep 11, 2021
1 parent bc3acb0 commit ca617df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node/util.ts
Expand Up @@ -20,7 +20,7 @@ export interface Paths {

// From https://github.com/chalk/ansi-regex
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-PR-TZcf-ntqry=><~]))",
].join("|")
const re = new RegExp(pattern, "g")
Expand Down

0 comments on commit ca617df

Please sign in to comment.