Vulnerabilities/

Inefficient Regular Expression Complexity in nth-check

Severity:
High

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:

References

Related Issues

Tags:
npm
nth-check
Anything's wrong? Let us know Last updated on November 29, 2023