{"schemaVersion":3,"id":"CVE-2021-43854","aliases":["GHSA-f8m6-h2c7-8h9x","PYSEC-2021-859","UBUNTU-CVE-2021-43854","DEBIAN-CVE-2021-43854"],"status":"published","duplicateOf":null,"title":null,"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.","dates":{"published":"2021-12-23T17:55:11.000Z","modified":"2024-08-04T04:10:16.281Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.5,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","exploitability":null,"impact":null,"computed":false},{"version":"4.0","versionLabel":"v4.0","source":"OSV · Pypi","score":8.7,"severity":"high","vector":"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","exploitability":null,"impact":null,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Pypi","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","exploitability":10,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","exploitability":10,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","exploitability":10,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":5,"severity":"medium","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.0279,"percentile":0.86221,"severity":"low","asOf":"2026-10-19T00:00:00.000Z","change":{"pp":0.12200000000000023,"baselineDate":"2026-09-19T00:00:00.000Z","baselineScore":0.02668},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.0279,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.0279,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.0279,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.0279,"percentile":0.86221}],"last30":[{"date":"2026-09-19T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.02668,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.02595,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.0279,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.0279,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.0279,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.0279,"percentile":0.86221}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"GITHUB_NLTK_NLTK","name":"Nltk","source":"github","url":"https://github.com/nltk/nltk/security/advisories/GHSA-f8m6-h2c7-8h9x","maturity":"poc","reliabilityScore":0.3,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption","description":"The product does not properly control the allocation and maintenance of a limited resource.","type":"weakness","status":"Draft","abstraction":"Class","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/400.html"}],"affected":[{"vendor":"debian","product":"nltk","name":"nltk","label":"nltk","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/nltk","purlType":"deb","versions":[{"text":"< 3.6.7-1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 3.6.7-1","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"nltk","name":"nltk","label":"nltk","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/nltk","purlType":"deb","versions":[{"text":"< 2.0~b9-0ubuntu4.1~esm4","noFixRecorded":false,"fixedIn":null},{"text":"< 3.1-1ubuntu0.1+esm2","noFixRecorded":false,"fixedIn":null},{"text":"< 3.2.5-1ubuntu0.1+esm2","noFixRecorded":false,"fixedIn":null},{"text":"< 3.4.5-2ubuntu0.1~esm2","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.0~b9-0ubuntu4.1~esm4 | < 3.1-1ubuntu0.1+esm2 | < 3.2.5-1ubuntu0.1+esm2 | < 3.4.5-2ubuntu0.1~esm2","eol":null,"hubHref":null},{"vendor":"nltk","product":"nltk","name":"nltk","label":"nltk","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 3.6.5","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 3.6.5","eol":null,"hubHref":"/vendor/nltk/nltk"},{"vendor":"PyPI","product":"nltk","name":"nltk","label":"nltk","ecosystem":"PyPI","cpePart":null,"purl":"pkg:pypi/nltk","purlType":"pypi","versions":[{"text":"< 3.6.6","noFixRecorded":false,"fixedIn":null},{"text":"< 1405aad979c6b8080dbbc8e0858f89b2e3690341","noFixRecorded":false,"fixedIn":null},{"text":"< 3.6.5","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 3.6.6 | < 1405aad979c6b8080dbbc8e0858f89b2e3690341 | < 3.6.5","eol":null,"hubHref":null}],"affectedCount":4,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/nltk/nltk/security/advisories/GHSA-f8m6-h2c7-8h9x","label":"github.com/nltk/nltk/security/advisories/GHSA-f8m6-h2c7-8h9x","hostname":"github.com","tags":["X Refsource CONFIRM","WEB","Advisory","REPORT","Exploit","Patch","Third Party Advisory"]},{"url":"https://github.com/nltk/nltk/issues/2866","label":"github.com/nltk/nltk/issues/2866","hostname":"github.com","tags":["X Refsource MISC","WEB","REPORT","Exploit","Issue Tracking","Patch","Third Party Advisory"]},{"url":"https://github.com/nltk/nltk/pull/2869","label":"github.com/nltk/nltk/pull/2869","hostname":"github.com","tags":["X Refsource MISC","WEB","REPORT","Exploit","Patch","Third Party Advisory"]},{"url":"https://github.com/nltk/nltk/commit/1405aad979c6b8080dbbc8e0858f89b2e3690341","label":"github.com/nltk/nltk/commit/1405aad979c6b8080dbbc8e0858f89b2e3690341","hostname":"github.com","tags":["X Refsource MISC","WEB","FIX","REPORT","Patch","Third Party Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-43854","label":"nvd.nist.gov/vuln/detail/CVE-2021-43854","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/nltk/nltk","label":"github.com/nltk/nltk","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2021-859.yaml","label":"github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2021-859.yaml","hostname":"github.com","tags":["WEB"]},{"url":"https://ubuntu.com/security/CVE-2021-43854","label":"ubuntu.com/security/CVE-2021-43854","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-43854","label":"www.cve.org/CVERecord?id=CVE-2021-43854","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-7365-1","label":"ubuntu.com/security/notices/USN-7365-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-43854","label":"security-tracker.debian.org/tracker/CVE-2021-43854","hostname":"security-tracker.debian.org","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":["USN-7365-1"],"duplicates":[],"related":["USN-7365-1"]},"timeline":[{"kind":"published","date":"2021-12-23T17:55:11.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-04T04:10:16.281Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":41,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-19T17:04:16.287Z","stale":false,"partial":false}}