Resource exhaustion in Nltk

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. 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.

Vulnerability class: DoS (Denial of Service)

Published · last modified .

CVSS v3 metric

CVSS v3 base score 7.5 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.

EPSS exploit prediction

EPSS: 0.026 (84.7th percentile), scored .

Low probability of exploitation in the next 30 days, but still tracked. 85th percentile — 84.7% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.

EPSS trend (30 days)EPSS over the last 30 days for CVE-2021-43854: held from 0.027 to 0.026.

EPSS over last 30 days · oldest: 0.027 · newest: 0.026 · change: -0.001

Affected products

  • Nltk — versions < 3.6.5

Weakness classification (CWE)

Public proof-of-concept exploits

References

Frequently asked questions

What is CVE-2021-43854?
CVE-2021-43854 is a high-severity vulnerability in Nltk, classified under Uncontrolled Resource Consumption. CVSS score: 7.5/10. Published 2021-12-23.
How severe is CVE-2021-43854?
High severity. CVSS v3 base score is 7.5 out of 10.
Is CVE-2021-43854 known to be exploited?
3 public proof-of-concept repositories are indexed. Not currently listed in the CISA KEV catalog.