CVE-2021-43854: nltk Uncontrolled Resource Consumption
Vulnerability summary
CVE-2021-43854 is a high (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in nltk. EPSS estimates a 2.79% chance of exploitation in the next 30 days, higher than 86.2% of scored vulnerabilities. 1 public exploit is recorded.
Advisory lineage
Upstream 0 · Downstream 1 · Related 1Timeline
- 23-12-2021PublishedVulnerability first disclosed.
- 04-08-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
7 scores · 5 sources · 3 versions- OSV · PypiEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · UbuntuEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · DebianEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- NVDNIST7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS trend
Probability
2.79%
Chance of exploitation in the next 30 days
Percentile
86%
Versus all other CVEs
30-day change
+0.12 pp
From 2.67% on 18-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundNltk
Maturity: poc
Weaknesses
CWE · root causeAffected systems
Debian1 product
- nltk< 3.6.7-1
Nltk1 product
- nltk< 3.6.5
PyPI1 product
- nltk< 3.6.6 | < 1405aad979c6b8080dbbc8e0858f89b2e3690341 | < 3.6.5
Ubuntu1 product
- nltk< 2.0~b9-0ubuntu4.1~esm4 | < 3.1-1ubuntu0.1+esm2 | < 3.2.5-1ubuntu0.1+esm2 | < 3.4.5-2ubuntu0.1~esm2
4 vendors · 4 products
References
11 links- github.com/nltk/nltk/security/advisories/GHSA-f8m6-h2c7-8h9xX Refsource CONFIRMWEBAdvisoryREPORTExploitPatchThird Party Advisory
- github.com/nltk/nltk/issues/2866X Refsource MISCWEBREPORTExploitIssue TrackingPatchThird Party Advisory
- github.com/nltk/nltk/commit/1405aad979c6b8080dbbc8e0858f89b2e3690341X Refsource MISCWEBFIXREPORTPatchThird Party Advisory
- github.com/nltk/nltkPACKAGE