CVE-2021-43854: NLTK - Regular Expression Denial of Service
- Cve: CVE-2021-43854
- Name: NLTK - Regular Expression Denial of Service
- 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.
- Impact: Attackers can cause denial of service by triggering excessive processing time in tokenization functions.
- Remediation: Upgrade to NLTK 3.6.5 or later, or limit input length to vulnerable functions.
- Vulnerability type: regular_expression_dos
- Vulnerability impact: denial_of_service
- Requirement type: none
- Labels source: projectdiscovery
- Severity: high
- Cvss score: 7.5
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Epss score: 0.0279
- Epss percentile: 0.8667
- Assignee: [email protected]
- Published at: 2021-12-23T18:15:07Z
- Age in days: 1797
- Modified at: 2026-06-17T04:11:34Z
- Patch available: yes
- Public exploits total: 3
- References total: 4
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-43854
- Nvd status: modified
- Checked, none or zero: known exploited entries, nuclei templates, public exploits capped, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-400 | Uncontrolled Resource Consumption |
Public exploits
Same in every row:
- Source: nvd
- Added date: 2021-12-23
| Url |
|---|
| https://github.com/nltk/nltk/issues/2866 |
| https://github.com/nltk/nltk/pull/2869 |
| https://github.com/nltk/nltk/security/advisories/GHSA-f8m6-h2c7-8h9x |
References
Same in every row:
- Source: nvd
| Url | Tags |
|---|---|
| https://github.com/nltk/nltk/commit/1405aad979c6b8080dbbc8e0858f89b2e3690341 | Patch, Third Party Advisory |
| https://github.com/nltk/nltk/issues/2866 | Exploit, Issue Tracking, Patch, Third Party Advisory |
| https://github.com/nltk/nltk/pull/2869 | Exploit, Patch, Third Party Advisory |
| https://github.com/nltk/nltk/security/advisories/GHSA-f8m6-h2c7-8h9x | Exploit, Patch, Third Party Advisory |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| nltk:nltk | < 3.6.5 | no | nvd | /v1/products/nltk/nltk |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| nltk/nltk | commit, fix, issues, package, pull, security_advisory | yes | /v1/repositories/nltk/nltk |
Index
- Repositories: 459
- Repositories high signal: 221
- Packages: 1
Exploitation
- Public exploit: yes
- Public exploit count: 3
- Public exploit first date: 2021-12-23
- Remote: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, authentication required
- Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts