CVE catalog

CVE-2021-43854

nltk: CVE-2021-43854

[CVE catalog]

Severity
Medium
Published
Source
[NVD] · [CVE record]
EPSS
2.79% · Oct 27, 2026

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.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debiannltksid3.10.3-1fixed
Debiannltkforky3.10.3-1fixed
Debiannltktrixie3.9.1-2fixed
Debiannltkbookworm3.8-1fixed
Ubuntunltkpro3.4.5-1vulnerable
Ubuntunltkpro3.4.5-2vulnerable
Ubuntunltkpro3.4.5-2ubuntu0.1~esm1vulnerable
Ubuntunltkpro3.4.5-2ubuntu0.1~esm2fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debiannltksourcesid3.6.7-1not yet assignedNot reported[1002623]
Debiannltksourceforky3.6.7-1not yet assignedNot reported[1002623]
Debiannltksourcetrixie3.6.7-1not yet assignedNot reported[1002623]
Debiannltksourcebookworm3.6.7-1not yet assignedNot reported[1002623]
Ubuntunltkdebpro3.4.5-2ubuntu0.1~esm2Not reportedUBUNTU-CVE-2021-43854Not reported

[Debian bug #1002623]

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • Source package: [nltk]

    Details (2)
    • 3.8-1 · all · bookworm

      Fixed · Fixed: 3.6.7-1

      dsa · nltk · debian · bookworm; dsa · nltk · debian · 12

    • 3.8-1 · all · bookworm

      Fixed · Fixed: 3.6.7-1

      dsa · nltk · debian · bookworm; dsa · nltk · debian · 12

[Debian 13 (Trixie)]

  • Source package: [nltk]

    Details (2)
    • 3.9.1-2 · all · trixie

      Fixed · Fixed: 3.6.7-1

      dsa · nltk · debian · 13

    • 3.9.1-2 · all · trixie

      Fixed · Fixed: 3.6.7-1

      dsa · nltk · debian · 13

Observed:

References