{"id":"CVE-2021-3842","aliases":["DEBIAN-CVE-2021-3842","EUVD-2022-0162","GHSA-rqjh-jp2r-59cj","PYSEC-2022-5","UBUNTU-CVE-2021-3842","USN-7365-1"],"status":"published","title":"Inefficient Regular Expression Complexity in nltk/nltk","description":"nltk is vulnerable to Inefficient Regular Expression Complexity","severity":{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.01571,"percentile":0.75714,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-1333"],"published":"2022-01-04T14:50:09Z","modified":"2026-10-23T18:05:23Z","fixes":[{"ecosystem":"PyPI","package":"nltk","fixed_in":["3.6.6"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:12","package":"nltk","fixed_in":["3.6.7-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"nltk","fixed_in":["3.6.7-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"nltk","fixed_in":["3.6.7-1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:14.04:LTS","package":"nltk","fixed_in":["2.0~b9-0ubuntu4.1~esm4"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:16.04:LTS","package":"nltk","fixed_in":["3.1-1ubuntu0.1+esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:18.04:LTS","package":"nltk","fixed_in":["3.2.5-1ubuntu0.1+esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:20.04:LTS","package":"nltk","fixed_in":["3.4.5-2ubuntu0.1~esm2"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.6"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.7-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.7-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.7-1"}]}]},{"source":"osv","ecosystem":"PyPI","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.6"}]}],"versions":["0.8","0.9","0.9.3","0.9.4","0.9.5","0.9.6","0.9.7","0.9.8","0.9.9","2.0.1","2.0.1rc1","2.0.1rc2-git","2.0.1rc3","2.0.1rc4","2.0.2","2.0.3","2.0.4","2.0.5","2.0b4","2.0b5","2.0b6","2.0b7","2.0b8","2.0b9","3.0.0","3.0.0b1","3.0.0b2","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.1","3.2","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5","3.3","3.4","3.4.1","3.4.2","3.4.3","3.4.4","3.4.5","3.5","3.5b1","3.6","3.6.1","3.6.2","3.6.3","3.6.4","3.6.5"]},{"source":"osv","ecosystem":"PyPI","package":"nltk","ranges":[{"type":"GIT","events":[{"introduced":"0"},{"fixed":"2a50a3edc9d35f57ae42a921c621edc160877f4d"}]},{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.6.6"}]}],"versions":["0.8","0.9","0.9.3","0.9.4","0.9.5","0.9.6","0.9.7","0.9.8","0.9.9","2.0.1","2.0.1rc1","2.0.1rc2-git","2.0.1rc3","2.0.1rc4","2.0.2","2.0.3","2.0.4","2.0.5","2.0b4","2.0b5","2.0b6","2.0b7","2.0b8","2.0b9","3.0.0","3.0.0b1","3.0.0b2","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.1","3.2","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5","3.3","3.4","3.4.1","3.4.2","3.4.3","3.4.4","3.4.5","3.5","3.5b1","3.6","3.6.1","3.6.2","3.6.3","3.6.4","3.6.5"]},{"source":"osv","ecosystem":"Ubuntu:Pro:14.04:LTS","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0~b9-0ubuntu4.1~esm4"}]}],"versions":["2.0~b9-0ubuntu4","2.0~b9-0ubuntu4.1~esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1-1ubuntu0.1+esm2"}]}],"versions":["3.0.4-1","3.0.5-1","3.1-1","3.1-1ubuntu0.1","3.1-1ubuntu0.1+esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.5-1ubuntu0.1+esm2"}]}],"versions":["3.2.4-1","3.2.5-1","3.2.5-1ubuntu0.1","3.2.5-1ubuntu0.1+esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.5-2ubuntu0.1~esm2"}]}],"versions":["3.4.5-1","3.4.5-2","3.4.5-2ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:14.04:LTS","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0~b9-0ubuntu4.1~esm4"}]}],"versions":["2.0~b9-0ubuntu4","2.0~b9-0ubuntu4.1~esm2"],"bundled":2},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1-1ubuntu0.1+esm2"}]}],"versions":["3.0.4-1","3.0.5-1","3.1-1","3.1-1ubuntu0.1","3.1-1ubuntu0.1+esm1"],"bundled":2},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.5-1ubuntu0.1+esm2"}]}],"versions":["3.2.4-1","3.2.5-1","3.2.5-1ubuntu0.1","3.2.5-1ubuntu0.1+esm1"],"bundled":2},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"nltk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.4.5-2ubuntu0.1~esm2"}]}],"versions":["3.4.5-1","3.4.5-2","3.4.5-2ubuntu0.1~esm1"],"bundled":2}],"products":[{"vendor":"debian","product":"debian_linux"},{"vendor":"fedoraproject","product":"fedora"},{"vendor":"nltk","product":"nltk"},{"vendor":"nltk","product":"nltk/nltk"}],"references":[{"url":"https://huntr.dev/bounties/761a761e-2be2-430a-8d92-6f74ffe9866a","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Issue Tracking","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/nltk/nltk/commit/2a50a3edc9d35f57ae42a921c621edc160877f4d","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-3842","tags":["advisory"]},{"url":"https://github.com/nltk/nltk/pull/2906","tags":["web","report"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2022-5.yaml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-rqjh-jp2r-59cj","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-3842","tags":["advisory"]},{"url":"https://github.com/nltk/nltk","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2021-3842","tags":["report"]},{"url":"https://huntr.dev/bounties/761a761e-2be2-430a-8d92-6f74ffe9866a/","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-3842","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-7365-1","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2021-43854","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2021-3842","title":"Inefficient Regular Expression Complexity in nltk/nltk","description":"nltk is vulnerable to Inefficient Regular Expression Complexity","status":"published","published":"2022-01-04T14:50:09Z","modified":"2024-08-03T17:09:09.531Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T14:33:04.020035Z"}],"euvd":[{"id":"EUVD-2022-0162","description":"nltk is vulnerable to Inefficient Regular Expression Complexity","status":"published","published":"2022-01-04T14:50:09Z","modified":"2024-08-03T17:09:09Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-03T03:25:11.376657Z"}],"ghsa":[{"id":"GHSA-rqjh-jp2r-59cj","title":"NLTK Vulnerable to REDoS","description":"NLTK is vulnerable to REDoS in some RegexpTaggers used in the functions `get_pos_tagger` and `malt_regex_tagger`.","status":"published","published":"2022-01-06T22:24:14Z","modified":"2024-09-26T14:14:43Z","cvss":[{"version":"4.0","score":8.7,"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","level":"high"},{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T14:38:06.29677Z"}],"nvd":[{"id":"CVE-2021-3842","description":"nltk is vulnerable to Inefficient Regular Expression Complexity","status":"published","published":"2022-01-04T15:15:07.833Z","modified":"2026-06-17T04:05:52.633Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"primary"},{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"secondary"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T14:07:03.418194Z"}],"osv":[{"id":"CVE-2021-3842","description":"nltk is vulnerable to Inefficient Regular Expression Complexity","status":"published","published":"2022-01-04T15:15:07.833Z","modified":"2026-11-10T02:30:44.709178669Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-09T10:53:57.550641Z"},{"id":"DEBIAN-CVE-2021-3842","description":"nltk is vulnerable to Inefficient Regular Expression Complexity","status":"published","published":"2022-01-04T15:15:07.833Z","modified":"2026-10-23T18:05:23.098034419Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:45:35.521549Z"},{"id":"GHSA-rqjh-jp2r-59cj","title":"NLTK Vulnerable to REDoS","description":"NLTK is vulnerable to REDoS in some RegexpTaggers used in the functions `get_pos_tagger` and `malt_regex_tagger`.","status":"published","published":"2022-01-06T22:24:14Z","modified":"2024-09-26T14:44:52.377622Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"},{"version":"4.0","score":8.7,"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","level":"high"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T15:46:56.281047Z"},{"id":"UBUNTU-CVE-2021-3842","description":"nltk is vulnerable to Inefficient Regular Expression Complexity","status":"published","published":"2022-01-04T15:15:00Z","modified":"2026-02-05T14:26:28.687851Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:54:28.526929Z"},{"id":"PYSEC-2022-5","description":"nltk is vulnerable to Inefficient Regular Expression Complexity","status":"published","published":"2022-01-04T15:15:00Z","modified":"2023-11-08T04:06:27.635193Z","updated_at":"2026-11-02T15:52:53.837392Z"},{"id":"USN-7365-1","title":"nltk vulnerabilities","description":"It was discovered that NLTK contained a regex that is susceptible to\ncatastrophic backtracking. An attacker could possibly use this issue to\ncause a denial of service. (CVE-2021-3842, CVE-2021-43854)\n","status":"published","published":"2025-03-24T01:55:52Z","modified":"2026-06-25T13:32:19.437594541Z","updated_at":"2026-11-02T16:58:19.988474Z"}]}}
