High, CVSS 7.5npmAmendedPublished
Inefficient Regular Expression Complexity in nth-check
CVE-2021-3803 · GHSA-rp65-9cf3-cjxr
- Affected
- npm nth-check < 2.0.1
- Fixed in
- 2.0.1· Vendor fix available
- Issue
- 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. Proof of Concept The Output
Recommended action: Upgrade to 2.0.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.