Vulnerability library
Security checkNovember 29, 2023

Inefficient Regular Expression Complexity in nth-check

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

High severitynpmnth-check

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

There is a Regular Expression Denial of Service (ReDoS) vulnerability in nth-check that causes a denial of service when parsing crafted invalid CSS nth-checks.

The ReDoS vulnerabilities of the regex are mainly due to the sub-pattern \s*(?:([+-]?)\s*(\d+))? with quantified overlapping adjacency and can be exploited with the following code.

Recommendation

Update the nth-check package to the latest compatible version. Followings are version details:

  • Affected version(s): < 2.0.1
  • Patched version(s): 2.0.1

References

Could your website be exposed too?

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

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated November 29, 2023