mirror of
https://github.com/cdr/code-server.git
synced 2025-12-06 16:34:35 +01:00
Merge pull request #4158 from ready-research/ReDoS
fix(security): fix ReDoS in Regex
This commit is contained in:
commit
1d4ffda1f8
1 changed files with 1 additions and 1 deletions
|
|
@ -20,7 +20,7 @@ export interface Paths {
|
||||||
|
|
||||||
// From https://github.com/chalk/ansi-regex
|
// From https://github.com/chalk/ansi-regex
|
||||||
const pattern = [
|
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=><~]))",
|
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))",
|
||||||
].join("|")
|
].join("|")
|
||||||
const re = new RegExp(pattern, "g")
|
const re = new RegExp(pattern, "g")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue