CVE-2021-3828
Inefficient Regular Expression Complexity in nltk/nltk
nltk is vulnerable to Inefficient Regular Expression Complexity
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.5
Inefficient Regular Expression Complexity in nltk/nltk
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
CVE-2021-3828- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333
- Updated
- 2026-11-02
EUVDEUVD-2021-0147
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
EUVD-2021-0147- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-2ww3-fxvq-293j
8.7
NLTK Vulnerable to REDoS
The nltk package is vulnerable to ReDoS (regular expression denial of service). An attacker that is able to provide as an input to the [_read_comparison_block()(https://github.com/nltk/nltk/blob/23f4b1c4b4006b0cb3ec278e801029557cec4e82/nltk/corpus/reader/comparative_sents.py#L259) function in the file nltk/corpus/reader/comparative_sents.py may cause an application to consume an excessive amount of CPU.
- Record
GHSA-2ww3-fxvq-293j- CVSS 4.0
- 8.7 High
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 - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-697, CWE-1333
- Updated
- 2026-11-02
NVD
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
CVE-2021-3828- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:N/A:P - Weakness
- CWE-1333, CWE-697
- Updated
- 2026-11-02
OSV
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
CVE-2021-3828- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-3828
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
DEBIAN-CVE-2021-3828- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 8 moreShow less
OSVGHSA-2ww3-fxvq-293j
8.7
NLTK Vulnerable to REDoS
The nltk package is vulnerable to ReDoS (regular expression denial of service). An attacker that is able to provide as an input to the [_read_comparison_block()(https://github.com/nltk/nltk/blob/23f4b1c4b4006b0cb3ec278e801029557cec4e82/nltk/corpus/reader/comparative_sents.py#L259) function in the file nltk/corpus/reader/comparative_sents.py may cause an application to consume an excessive amount of CPU.
- Record
GHSA-2ww3-fxvq-293j- CVSS 4.0
- 8.7 High
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 - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333, CWE-697
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2021-3828
7.5
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
UBUNTU-CVE-2021-3828- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVMGASA-2023-0302 No score
Updated python-nltk package fixes a security vulnerability
python-nltk 3.6.6 update resolves ReDoS opportunity by fixing incorrectly specified regex
- Record
MGASA-2023-0302- Updated
- 2026-11-02
OSVopenSUSE-SU-2022:10040-1 No score
Security update for python-nltk
This update for python-nltk fixes the following issues:
Update to 3.7
-
Improve and update the NLTK team page on nltk.org (#2855, #2941)
-
Drop support for Python 3.6, support Python 3.10 (#2920)
-
Update to 3.6.7
- Resolve IndexError in
sent_tokenizeandword_tokenize(#2922)
- Resolve IndexError in
-
Update to 3.6.6
- Refactor
gensim.doctestto work for gensim 4.0.0 and up (#2914) - Add Precision, Recall, F-measure, Confusion Matrix to Taggers (#2862)
- Added warnings if .zip files exist without any corresponding .csv files. (#2908)
- Fix
FileNotFoundErrorwhen thedownload_diris a non-existing nested folder (#2910) - Rename omw to omw-1.4 (#2907)
- Resolve ReDoS opportunity by fixing incorrectly specified regex (#2906, boo#1191030, CVE-2021-3828).
- Support OMW 1.4 (#2899)
- Deprecate Tree get and set node methods (#2900)
- Fix broken inaugural test case (#2903)
- Use Multilingual Wordnet Data from OMW with newer Wordnet versions (#2889)
- Keep NLTKs 'tokenize' module working with pathlib (#2896)
- Make prettyprinter to be more readable (#2893)
- Update links to the nltk book (#2895)
- Add
CITATION.cffto nltk (#2880) - Resolve serious ReDoS in PunktSentenceTokenizer (#2869)
- Delete old CI config files (#2881)
- Improve Tokenize documentation + add TokenizerI as superclass for TweetTokenizer (#2878)
- Fix expected value for BLEU score doctest after changes from #2572
- Add multi Bleu functionality and tests (#2793)
- Deprecate 'return_str' parameter in NLTKWordTokenizer and TreebankWordTokenizer (#2883)
- Allow empty string in CFG's + more (#2888)
- Partition
tree.pymodule intotreepackage + pickle fix (#2863) - Fix several TreebankWordTokenizer and NLTKWordTokenizer bugs (#2877)
- Rewind Wordnet data file after each lookup (#2868)
- Correct init call for SyntaxCorpusReader subclasses (#2872)
- Documentation fixes (#2873)
- Fix levenstein distance for duplicated letters (#2849)
- Support alternative Wordnet versions (#2860)
- Remove hundreds of formatting warnings for nltk.org (#2859)
- Modernize
nltk.org/howtopages (#2856) - Fix Bleu Score smoothing function from taking log(0) (#2839)
- Update third party tools to newer versions and removing MaltParser fixed version (#2832)
- Fix TypeError: _pretty() takes 1 positional argument but 2 were given in sem/drt.py (#2854)
- Replace
httpwithhttpsin most URLs (#2852)
- Refactor
-
Update to 3.6.5
- modernised nltk.org website
- addressed LGTM.com issues
- support ZWJ sequences emoji and skin tone modifer emoji in TweetTokenizer
- METEOR evaluation now requires pre-tokenized input
- Code linting and type hinting
- implement get_refs function for DrtLambdaExpression
- Enable automated CoreNLP, Senna, Prover9/Mace4, Megam, MaltParser CI tests
- specify minimum regex version that supports regex.Pattern
- avoid re.Pattern and regex.Pattern which fail for Python 3.6, 3.7
-
Update to 3.6.4
- deprecate
nltk.usage(obj)in favor ofhelp(obj) - resolve ReDoS vulnerability in Corpus Reader
- solidify performance tests
- improve phone number recognition in tweet tokenizer
- refactored CISTEM stemmer for German
- identify NLTK Team as the author
- replace travis badge with github actions badge
- add SECURITY.md
- deprecate
-
Update to 3.6.3
- Dropped support for Python 3.5
- Run CI tests on Windows, too
- Moved from Travis CI to GitHub Actions
- Code and comment cleanups
- Visualize WordNet relation graphs using Graphviz
- Fixed large error in METEOR score
- Apply isort, pyupgrade, black, added as pre-commit hooks
- Prevent debug_decisions in Punkt from throwing IndexError
- Resolved ZeroDivisionError in RIBES with dissimilar sentences
- Initialize WordNet IC total counts with smoothing value
- Fixed AttributeError for Arabic ARLSTem2 stemmer
- Many fixes and improvements to lm language…
- Record
openSUSE-SU-2022:10040-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:11958-1 No score
python310-nltk-3.7-1.1 on GA media
These are all security issues fixed in the python310-nltk-3.7-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:11958-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2025:15099-1 No score
python311-nltk-3.9.1-2.4 on GA media
These are all security issues fixed in the python311-nltk-3.9.1-2.4 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2025:15099-1- Updated
- 2026-11-02
OSVPYSEC-2021-356 No score
nltk is vulnerable to Inefficient Regular Expression Complexity
- Record
PYSEC-2021-356- Updated
- 2026-11-02
OSVUSN-5215-1 No score
nltk vulnerability
Srikantha Prathi discovered that NLTK incorrectly handled specially crafted input. An attacker could use this vulnerability to cause a denial of service.
- Record
USN-5215-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
nltkPyPI |
before 3.6.4 | 3.6.4 |
nltkDebian:12 |
before 3.6.5-1 | 3.6.5-1 |
nltkDebian:13 |
before 3.6.5-1 | 3.6.5-1 |
nltkDebian:14 |
before 3.6.5-1 | 3.6.5-1 |
nltkPyPI |
before 3.6.4, plus listed versions 0.80.90.9.30.9.40.9.5 Show 45 moreShow less0.9.60.9.70.9.80.9.92.0.12.0.1rc12.0.1rc2-git2.0.1rc32.0.1rc42.0.22.0.32.0.42.0.52.0b42.0b52.0b62.0b72.0b82.0b93.0.03.0.0b13.0.0b23.0.13.0.23.0.33.0.43.0.53.13.23.2.13.2.23.2.33.2.43.2.53.33.43.4.13.4.23.4.33.4.43.4.53.53.5b13.63.6.1 |
3.6.4 |
python-nltkMageia:8 |
before 3.6.6-1.mga8 | 3.6.6-1.mga8 |
python-regexMageia:8 |
before 2022.9.13-1.mga8 | 2022.9.13-1.mga8 |
nltkUbuntu:Pro:16.04:LTS |
before 3.1-1ubuntu0.1+esm1, plus listed versions 3.0.4-13.0.5-13.1-13.1-1ubuntu0.1 |
3.1-1ubuntu0.1+esm1 |
nltkUbuntu:Pro:18.04:LTS |
before 3.2.5-1ubuntu0.1+esm1, plus listed versions 3.2.4-13.2.5-13.2.5-1ubuntu0.1 |
3.2.5-1ubuntu0.1+esm1 |
nltkUbuntu:Pro:20.04:LTS |
before 3.4.5-2ubuntu0.1~esm1, plus listed versions 3.4.5-13.4.5-2 |
3.4.5-2ubuntu0.1~esm1 |
Show 4 moreShow less
| Package | Affected | Fixed |
|---|---|---|
nltkUbuntu:22.04:LTS |
before 3.6.5-1, plus listed versions 3.5-1 |
3.6.5-1 |
python-nltkSUSE:Package Hub 15 SP2 From an advisory covering 2 CVEs |
before 3.7-bp152.3.3.1 | 3.7-bp152.3.3.1 |
python-nltkopenSUSE:Tumbleweed |
before 3.7-1.1 | 3.7-1.1 |
python-nltkopenSUSE:Tumbleweed |
before 3.9.1-2.4 | 3.9.1-2.4 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-3828 is a high vulnerability (CVSS 7.5) in Nltk, published September 27, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.59%, the 75th percentile. Fixed in nltk 3.6.4.
References
huntr.dev/bounties/d19aed43-75bc-4a03-91a0-4d0bb516bc32
github.com/nltk/nltk/commit/277711ab1dec729e626b27aab6fa35ea5efbd7e6
nvd.nist.gov/vuln/detail/CVE-2021-3828
github.com/nltk/nltk/pull/2816
github.com/advisories/GHSA-2ww3-fxvq-293j
github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2021-356.yaml
Show 13 moreShow less
security-tracker.debian.org/tracker/CVE-2021-3828
github.com/nltk/nltk
advisories.mageia.org/MGASA-2023-0302.html
bugs.mageia.org/show_bug.cgi?id=30604
ubuntu.com/security/CVE-2021-3828
ubuntu.com/security/notices/USN-5215-1
cve.org/CVERecord?id=CVE-2021-3828
lists.opensuse.org/archives/list/[email protected]/thread/6ZUSFUYB3S2F4VLUQBWFBYRLCIHMR43P
bugzilla.suse.com/1146427
bugzilla.suse.com/1191030
suse.com/security/cve/CVE-2019-14751
suse.com/security/cve/CVE-2021-3828
lists.opensuse.org/archives/list/[email protected]/thread/IU7FYQGVQSZK33SCY55RWQPTCX6OVM3Q
Left out here: 2 versions and the rest of 1 source description. The JSON record has them.