Security mailing lists by PureSourceCode

CVE-2021-43854

HIGH 7.5CVSS 3.1

Inefficient Regular Expression Complexity in nltk (word_tokenize, sent_tokenize)

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.

Published
23 Dec 2021
Last modified
8 Jul 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-400
Also known as
GHSA-f8m6-h2c7-8h9xPYSEC-2021-859
Sources
NVDJSONOSV GHSA-f8m6-h2c7-8h9xJSONOSV PYSEC-2021-859JSON

Scores

SourceScored byVersionScoreVector / decision
OSV GitHub CVSS 4.0 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD security-advisories@github.com (Secondary) CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
OSV GitHub CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD nvd@nist.gov (Primary) CVSS 2.0 MEDIUM 5.0 AV:N/AC:L/Au:N/C:N/I:N/A:P

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD nltk nltk
cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*
< 3.6.5 3.6.5
OSV PyPI nltk < 3.6.6 3.6.6
OSV PyPI nltk < 3.6.5 3.6.5

References

History

  • 25 Nov 2026 20:33 UTC · NVD: first stored (published 23 Dec 2021)
  • 25 Nov 2026 20:12 UTC · OSV: first stored (published 23 Dec 2021)
  • 25 Nov 2026 20:11 UTC · OSV: first stored (published 6 Jan 2022)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.