CVE-2021-43854
published high CVSS 3.1 · 7.5Inefficient Regular Expression Complexity in nltk
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| nltk | — | nltk< 3.6.5 | Affected | Not stated | GitHub_M |
| Ubuntu | bionic | nltk | Advisory build | 3.2.5-1ubuntu0.1+esm2 | USN-7365-1 |
| Ubuntu | focal | nltk | Advisory build | 3.4.5-2ubuntu0.1~esm2 | USN-7365-1 |
| Ubuntu | trusty | nltk | Advisory build | 2.0~b9-0ubuntu4.1~esm4 | USN-7365-1 |
| Ubuntu | xenial | nltk | Advisory build | 3.1-1ubuntu0.1+esm2 | USN-7365-1 |
| Ubuntu | bionic | python-nltk | Advisory build | 3.2.5-1ubuntu0.1+esm2 | USN-7365-1 |
| Ubuntu | bionic | python3-nltk | Advisory build | 3.2.5-1ubuntu0.1+esm2 | USN-7365-1 |
| Ubuntu | focal | python3-nltk | Advisory build | 3.4.5-2ubuntu0.1~esm2 | USN-7365-1 |
Show 3 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Ubuntu | trusty | python-nltk | Advisory build | 2.0~b9-0ubuntu4.1~esm4 | USN-7365-1 |
| Ubuntu | xenial | python-nltk | Advisory build | 3.1-1ubuntu0.1+esm2 | USN-7365-1 |
| Ubuntu | xenial | python3-nltk | Advisory build | 3.1-1ubuntu0.1+esm2 | USN-7365-1 |
Description
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. Versions prior to 3.6.5 are vulnerable to regular expression denial of service (ReDoS) attacks. The vulnerability is present in PunktSentenceTokenizer, sent_tokenize and word_tokenize. Any users of this class, or these two functions, are vulnerable to the ReDoS attack. In short, a specifically crafted long input to any of these vulnerable functions will cause them to take a significant amount of execution time. If your program relies on any of the vulnerable functions for tokenizing unpredictable user input, then we would strongly recommend upgrading to a version of NLTK without the vulnerability. For users unable to upgrade the execution time can be bounded by limiting the maximum length of an input to any of the vulnerable functions. Our recommendation is to implement such a limit.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| nltk | nltk | < 3.6.5 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-400 CWE-400: Uncontrolled Resource Consumption
References
4Provider assertions
2GitHub_M · cna
Inefficient Regular Expression Complexity in nltk
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 8fffd4bdbd421cc023cc94c0fbd8520e2ca6b10cad60b4694115326960afedd6
- Ingested
- 23 Sep 2026, 07:56:36 UTC
- Source record
- Official CVE record