Vulnerability library
Security checkSeptember 21, 2023

Inefficient Regular Expression Complexity in chalk/ansi-regex

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

High severitynpmansi-regex

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

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

The ReDOS is mainly due to the sub-patterns [[\\]()#;?]* and (?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*){:target="_blank"}{:rel="noopener noreferrer"}*

Recommendation

Update the ansi-regex package to the latest compatible version. Followings are version details:

  • Affected version(s): **>= 3.0.0, < 3.0.1 >= 4.0.0, < 4.1.1 >= 5.0.0, < 5.0.1 >= 6.0.0, < 6.0.1**
  • Patched version(s): **3.0.1 4.1.1 5.0.1 6.0.1**

References

Could your website be exposed too?

SmartScanner can check your website for Inefficient Regular Expression Complexity in chalk/ansi-regex and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated September 21, 2023