CVE-2021-3842
Inefficient Regular Expression Complexity in nltk/nltk
nltk 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 nltk/nltk
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
CVE-2021-3842- 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-2022-0162
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
EUVD-2022-0162- 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-rqjh-jp2r-59cj
8.7
NLTK Vulnerable to REDoS
NLTK is vulnerable to REDoS in some RegexpTaggers used in the functions get_pos_tagger and malt_regex_tagger.
- Record
GHSA-rqjh-jp2r-59cj- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - 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
NVD
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
CVE-2021-3842- 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
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
CVE-2021-3842- 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-3842
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
DEBIAN-CVE-2021-3842- 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 4 moreShow less
OSVGHSA-rqjh-jp2r-59cj
8.7
NLTK Vulnerable to REDoS
NLTK is vulnerable to REDoS in some RegexpTaggers used in the functions get_pos_tagger and malt_regex_tagger.
- Record
GHSA-rqjh-jp2r-59cj- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - 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
OSVUBUNTU-CVE-2021-3842
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
UBUNTU-CVE-2021-3842- 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
OSVPYSEC-2022-5 No score
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
PYSEC-2022-5- Updated
- 2026-11-02
OSVUSN-7365-1 No score
nltk vulnerabilities
It was discovered that NLTK contained a regex that is susceptible to catastrophic backtracking. An attacker could possibly use this issue to cause a denial of service. (CVE-2021-3842, CVE-2021-43854)
- Record
USN-7365-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
nltkPyPI |
before 3.6.6 | 3.6.6 |
nltkDebian:12 |
before 3.6.7-1 | 3.6.7-1 |
nltkDebian:13 |
before 3.6.7-1 | 3.6.7-1 |
nltkDebian:14 |
before 3.6.7-1 | 3.6.7-1 |
nltkPyPI |
before 3.6.6, plus listed versions 0.80.90.9.30.9.40.9.5 Show 45 moreShow less0.9.60.9.70.9.80.9.92.0.12.0.1rc12.0.1rc2-git2.0.1rc32.0.1rc42.0.22.0.32.0.42.0.52.0b42.0b52.0b62.0b72.0b82.0b93.0.03.0.0b13.0.0b23.0.13.0.23.0.33.0.43.0.53.13.23.2.13.2.23.2.33.2.43.2.53.33.43.4.13.4.23.4.33.4.43.4.53.53.5b13.63.6.1 |
3.6.6 |
nltkUbuntu:Pro:14.04:LTS |
before 2.0~b9-0ubuntu4.1~esm4, plus listed versions 2.0~b9-0ubuntu42.0~b9-0ubuntu4.1~esm2 |
2.0~b9-0ubuntu4.1~esm4 |
nltkUbuntu:Pro:16.04:LTS |
before 3.1-1ubuntu0.1+esm2, plus listed versions 3.0.4-13.0.5-13.1-13.1-1ubuntu0.13.1-1ubuntu0.1+esm1 |
3.1-1ubuntu0.1+esm2 |
nltkUbuntu:Pro:18.04:LTS |
before 3.2.5-1ubuntu0.1+esm2, plus listed versions 3.2.4-13.2.5-13.2.5-1ubuntu0.13.2.5-1ubuntu0.1+esm1 |
3.2.5-1ubuntu0.1+esm2 |
nltkUbuntu:Pro:20.04:LTS |
before 3.4.5-2ubuntu0.1~esm2, plus listed versions 3.4.5-13.4.5-23.4.5-2ubuntu0.1~esm1 |
3.4.5-2ubuntu0.1~esm2 |
nltkUbuntu:Pro:14.04:LTS From an advisory covering 2 CVEs |
before 2.0~b9-0ubuntu4.1~esm4, plus listed versions 2.0~b9-0ubuntu42.0~b9-0ubuntu4.1~esm2 |
2.0~b9-0ubuntu4.1~esm4 |
nltkUbuntu:Pro:16.04:LTS From an advisory covering 2 CVEs |
before 3.1-1ubuntu0.1+esm2, plus listed versions 3.0.4-13.0.5-13.1-13.1-1ubuntu0.13.1-1ubuntu0.1+esm1 |
3.1-1ubuntu0.1+esm2 |
nltkUbuntu:Pro:18.04:LTS From an advisory covering 2 CVEs |
before 3.2.5-1ubuntu0.1+esm2, plus listed versions 3.2.4-13.2.5-13.2.5-1ubuntu0.13.2.5-1ubuntu0.1+esm1 |
3.2.5-1ubuntu0.1+esm2 |
nltkUbuntu:Pro:20.04:LTS From an advisory covering 2 CVEs |
before 3.4.5-2ubuntu0.1~esm2, plus listed versions 3.4.5-13.4.5-23.4.5-2ubuntu0.1~esm1 |
3.4.5-2ubuntu0.1~esm2 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| 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-3842 is a high vulnerability (CVSS 7.5) in Nltk, published January 4, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.57%, the 75th percentile. Fixed in nltk 3.6.6.
References
huntr.dev/bounties/761a761e-2be2-430a-8d92-6f74ffe9866a
github.com/nltk/nltk/commit/2a50a3edc9d35f57ae42a921c621edc160877f4d
nvd.nist.gov/vuln/detail/CVE-2021-3842
github.com/nltk/nltk/pull/2906
github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2022-5.yaml
github.com/advisories/GHSA-rqjh-jp2r-59cj
Left out here: 4 versions. The JSON record has them.