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
Related Issues
- string-kit Inefficient Regular Expression Complexity vulnerability - CVE-2021-4299
- Inefficient Regular Expression Complexity in chalk/ansi-regex - CVE-2021-3807
- Inefficient Regular Expression Complexity in validator.js - CVE-2021-3765
- Inefficient Regular Expression Complexity in handsontable - CVE-2021-23446
You might also like:
- Tags:
- npm
- nth-check
Anything's wrong? Let us know Last updated on November 29, 2023


