Skip to content

CVE-2021-43854 Inefficient Regular Expression Complexity in nltk

HighCVSS 7.5 EPSS 2.8%
Published
Updated
Exploit status
No public exploit known
Technology
UbuntuDebian

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.

Upgrade path

9 packages: 9 fixed.

PackageAffectedFixed inStatus
debian/nltk(Debian 12) < 3.6.7-1 3.6.7-1 Fixed
debian/nltk(Debian 13) < 3.6.7-1 3.6.7-1 Fixed
debian/nltk(Debian 14) < 3.6.7-1 3.6.7-1 Fixed
nltk < 3.6.5; = < 3.6.5 3.6.5 Fixed
pypi nltk(PyPI) < 3.6.5; < 3.6.6; = 0.8; = 0.9 +52 more 3.6.5, 3.6.6 Fixed
ubuntu/nltk(Ubuntu Pro 14.04) < 2.0~b9-0ubuntu4.1~esm4; = 2.0~b9-0ubuntu4; = 2.0~b9-0ubuntu4.1~esm2 2.0~b9-0ubuntu4.1~esm4 Fixed
ubuntu/nltk(Ubuntu Pro 16.04) < 3.1-1ubuntu0.1+esm2; = 3.0.4-1; = 3.0.5-1; = 3.1-1 +2 more 3.1-1ubuntu0.1+esm2 Fixed
ubuntu/nltk(Ubuntu Pro 18.04) < 3.2.5-1ubuntu0.1+esm2; = 3.2.4-1; = 3.2.5-1; = 3.2.5-1ubuntu0.1 +1 more 3.2.5-1ubuntu0.1+esm2 Fixed
ubuntu/nltk(Ubuntu Pro 20.04) < 3.4.5-2ubuntu0.1~esm2; = 3.4.5-1; = 3.4.5-2; = 3.4.5-2ubuntu0.1~esm1 3.4.5-2ubuntu0.1~esm2 Fixed

Affected products

ProductAffected versionsFixed in
pypi nltk(PyPI) < 3.6.6 3.6.6
pypi nltk(PyPI) = 0.8 No fix listed
pypi nltk(PyPI) = 0.9 No fix listed
pypi nltk(PyPI) = 0.9.3 No fix listed
pypi nltk(PyPI) = 0.9.4 No fix listed
pypi nltk(PyPI) = 0.9.5 No fix listed
pypi nltk(PyPI) = 0.9.6 No fix listed
pypi nltk(PyPI) = 0.9.7 No fix listed
pypi nltk(PyPI) = 0.9.8 No fix listed
pypi nltk(PyPI) = 0.9.9 No fix listed
pypi nltk(PyPI) = 2.0.1 No fix listed
pypi nltk(PyPI) = 2.0.1rc1 No fix listed
pypi nltk(PyPI) = 2.0.1rc2-git No fix listed
pypi nltk(PyPI) = 2.0.1rc3 No fix listed
pypi nltk(PyPI) = 2.0.1rc4 No fix listed
pypi nltk(PyPI) = 2.0.2 No fix listed
pypi nltk(PyPI) = 2.0.3 No fix listed
pypi nltk(PyPI) = 2.0.4 No fix listed
pypi nltk(PyPI) = 2.0.5 No fix listed
pypi nltk(PyPI) = 2.0b4 No fix listed
pypi nltk(PyPI) = 2.0b5 No fix listed
pypi nltk(PyPI) = 2.0b6 No fix listed
pypi nltk(PyPI) = 2.0b7 No fix listed
pypi nltk(PyPI) = 2.0b8 No fix listed
pypi nltk(PyPI) = 2.0b9 No fix listed
Show 54 more
ProductAffected versionsFixed in
pypi nltk(PyPI) = 3.0.0 No fix listed
pypi nltk(PyPI) = 3.0.0b1 No fix listed
pypi nltk(PyPI) = 3.0.0b2 No fix listed
pypi nltk(PyPI) = 3.0.1 No fix listed
pypi nltk(PyPI) = 3.0.2 No fix listed
pypi nltk(PyPI) = 3.0.3 No fix listed
pypi nltk(PyPI) = 3.0.4 No fix listed
pypi nltk(PyPI) = 3.0.5 No fix listed
pypi nltk(PyPI) = 3.1 No fix listed
pypi nltk(PyPI) = 3.2 No fix listed
pypi nltk(PyPI) = 3.2.1 No fix listed
pypi nltk(PyPI) = 3.2.2 No fix listed
pypi nltk(PyPI) = 3.2.3 No fix listed
pypi nltk(PyPI) = 3.2.4 No fix listed
pypi nltk(PyPI) = 3.2.5 No fix listed
pypi nltk(PyPI) = 3.3 No fix listed
pypi nltk(PyPI) = 3.4 No fix listed
pypi nltk(PyPI) = 3.4.1 No fix listed
pypi nltk(PyPI) = 3.4.2 No fix listed
pypi nltk(PyPI) = 3.4.3 No fix listed
pypi nltk(PyPI) = 3.4.4 No fix listed
pypi nltk(PyPI) = 3.4.5 No fix listed
pypi nltk(PyPI) = 3.5 No fix listed
pypi nltk(PyPI) = 3.5b1 No fix listed
pypi nltk(PyPI) = 3.6 No fix listed
pypi nltk(PyPI) = 3.6.1 No fix listed
pypi nltk(PyPI) = 3.6.2 No fix listed
pypi nltk(PyPI) = 3.6.3 No fix listed
pypi nltk(PyPI) = 3.6.4 No fix listed
pypi nltk(PyPI) = 3.6.5 No fix listed
pypi nltk(PyPI) < 3.6.5 3.6.5
debian/nltk(Debian:12) < 3.6.7-1 3.6.7-1
debian/nltk(Debian:13) < 3.6.7-1 3.6.7-1
debian/nltk(Debian:14) < 3.6.7-1 3.6.7-1
nltk < 3.6.5 3.6.5
nltk = < 3.6.5 No fix listed
ubuntu/nltk(Ubuntu:Pro:14.04) < 2.0~b9-0ubuntu4.1~esm4 2.0~b9-0ubuntu4.1~esm4
ubuntu/nltk(Ubuntu:Pro:14.04) = 2.0~b9-0ubuntu4 No fix listed
ubuntu/nltk(Ubuntu:Pro:14.04) = 2.0~b9-0ubuntu4.1~esm2 No fix listed
ubuntu/nltk(Ubuntu:Pro:16.04) < 3.1-1ubuntu0.1+esm2 3.1-1ubuntu0.1+esm2
ubuntu/nltk(Ubuntu:Pro:16.04) = 3.0.4-1 No fix listed
ubuntu/nltk(Ubuntu:Pro:16.04) = 3.0.5-1 No fix listed
ubuntu/nltk(Ubuntu:Pro:16.04) = 3.1-1 No fix listed
ubuntu/nltk(Ubuntu:Pro:16.04) = 3.1-1ubuntu0.1 No fix listed
ubuntu/nltk(Ubuntu:Pro:16.04) = 3.1-1ubuntu0.1+esm1 No fix listed
ubuntu/nltk(Ubuntu:Pro:18.04) < 3.2.5-1ubuntu0.1+esm2 3.2.5-1ubuntu0.1+esm2
ubuntu/nltk(Ubuntu:Pro:18.04) = 3.2.4-1 No fix listed
ubuntu/nltk(Ubuntu:Pro:18.04) = 3.2.5-1 No fix listed
ubuntu/nltk(Ubuntu:Pro:18.04) = 3.2.5-1ubuntu0.1 No fix listed
ubuntu/nltk(Ubuntu:Pro:18.04) = 3.2.5-1ubuntu0.1+esm1 No fix listed
ubuntu/nltk(Ubuntu:Pro:20.04) < 3.4.5-2ubuntu0.1~esm2 3.4.5-2ubuntu0.1~esm2
ubuntu/nltk(Ubuntu:Pro:20.04) = 3.4.5-1 No fix listed
ubuntu/nltk(Ubuntu:Pro:20.04) = 3.4.5-2 No fix listed
ubuntu/nltk(Ubuntu:Pro:20.04) = 3.4.5-2ubuntu0.1~esm1 No fix listed

References