High severity · published Dec 23, 2021
CVE-2021-43854
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing
7.5
CVSS
2.8%
EPSS
No
On KEV
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 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
None
Integrity
None
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)2.8% · higher than 86% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
NL
Nltk · Nltk
before 3.6.5 · source: NVD
Affected product
NL
Nltk
Nltk
More from Nltk
10.0
CVE-2026-0848
Arbitrary Code Execution in NLTK StanfordSegmenter via Untrusted JAR Loading
9.8
CVE-2026-79675
NLTK before 3.10.3 JVM Argument Injection via Per-Call Options
9.8
CVE-2026-79657
NLTK before 3.10.3 Remote Code Execution via Unsafe Pickle Deserialization
9.6
CVE-2026-78683
NLTK before 3.10.0 Remote Code Execution via Unsafe Pickle Deserialization
8.8
CVE-2026-71513
NLTK 3.10.0 through 3.10.2 Remote Code Execution via AllowlistUnpickler Dotted-Name Bypass