{"cve":"CVE-2021-43854","nvd":{"published":"2021-12-23T18:15:07.327","modified":"2026-06-17T04:11:34.653","status":"Modified","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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5},"cwes":["CWE-400"],"references":["https://github.com/nltk/nltk/commit/1405aad979c6b8080dbbc8e0858f89b2e3690341","https://github.com/nltk/nltk/issues/2866","https://github.com/nltk/nltk/pull/2869","https://github.com/nltk/nltk/security/advisories/GHSA-f8m6-h2c7-8h9x","https://github.com/nltk/nltk/commit/1405aad979c6b8080dbbc8e0858f89b2e3690341"],"products":["nltk:nltk"],"source":"nvd","synced_at":"2026-10-19T21:26:33.761856376+00:00"},"epss":{"cve":"CVE-2021-43854","score":0.0279,"percentile":0.8642,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-f8m6-h2c7-8h9x","url":"https://osv.dev/vulnerability/GHSA-f8m6-h2c7-8h9x","summary":"Inefficient Regular Expression Complexity in nltk (word_tokenize, sent_tokenize)","modified":"2026-07-08T06:28:12.494495711Z","packages":[{"ecosystem":"PyPI","name":"nltk","purl":"pkg:pypi/nltk","ranges":["<3.6.6"],"fixed":["3.6.6"]}]},{"id":"PYSEC-2021-859","url":"https://osv.dev/vulnerability/PYSEC-2021-859","summary":"","modified":"2023-11-08T04:07:14.650619Z","packages":[{"ecosystem":"PyPI","name":"nltk","purl":"pkg:pypi/nltk","ranges":["<3.6.5"],"fixed":["3.6.5"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}