CVE-2021-3842: Inefficient Regular Expression Complexity in nltk/nltk

Published Jan 4, 2022
·
Updated

Last updated 24 March 2025

Other sources

nltk is vulnerable to Inefficient Regular Expression Complexity

MITRE

NLTK is vulnerable to REDoS in some RegexpTaggers used in the functions getpostagger and maltregextagger.

GitHub

Affected Software

7 affected componentsFixes available
pip/nltk<3.6.6
3.6.6
debian/nltk<=3.5-1
3.8-13.9.1-2
nltk nltk<3.6.6
Debian Debian Linux=9.0
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Fedoraproject Fedora=35

Event History

Jan 4, 2022
CVE Published
via MITRE·02:50 PM
Data Sourced
via MITRE·02:50 PM
DescriptionSeverityWeakness
Jan 6, 2022
Advisory Published
via GitHub·10:24 PM
Mar 24, 2025
Data Sourced
via Launchpad·05:32 AM
Description
Mar 28, 2025
Data Sourced
via Ubuntu·05:33 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is CVE-2021-3842?

CVE-2021-3842 is a vulnerability in NLTK that allows for Regular Expression Denial of Service (REDoS) attacks in certain RegexpTaggers used in the functions `get_pos_tagger` and `malt_regex_tagger`.

2

How severe is CVE-2021-3842?

CVE-2021-3842 has a severity score of 7.5, which is considered high.

3

What software is affected by CVE-2021-3842?

NLTK version 3.6.6 installed through pip is affected by CVE-2021-3842.

4

How can I fix CVE-2021-3842?

To fix CVE-2021-3842, update NLTK to version 3.6.6 using pip.

5

Where can I find more information about CVE-2021-3842?

You can find more information about CVE-2021-3842 at the following references: [NVD](https://nvd.nist.gov/vuln/detail/CVE-2021-3842), [NLTK GitHub Commit](https://github.com/nltk/nltk/commit/2a50a3edc9d35f57ae42a921c621edc160877f4d), [Huntr Bounty](https://huntr.dev/bounties/761a761e-2be2-430a-8d92-6f74ffe9866a).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203