Every CVE Search/ Get API key

CVE-2021-3828

Inefficient Regular Expression Complexity in nltk/nltk

7.5 HighFix available

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

1.59%Up 1.0 points since Sep 28, 2021
90%50%10%1%

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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 3.0
7.5 HighCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
5.0 MediumAV: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 3.0
7.5 HighCVSS: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_tokenize and word_tokenize (#2922)
  • Update to 3.6.6

    • Refactor gensim.doctest to 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 FileNotFoundError when the download_dir is 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.cff to 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.py module into tree package + 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/howto pages (#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 http with https in most URLs (#2852)
  • 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 of help(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
  • 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

Affected packages
PackageAffectedFixed
nltk
PyPI
before 3.6.4
3.6.4
nltk
Debian:12
before 3.6.5-1
3.6.5-1
nltk
Debian:13
before 3.6.5-1
3.6.5-1
nltk
Debian:14
before 3.6.5-1
3.6.5-1
nltk
PyPI
before 3.6.4, plus listed versions
0.80.90.9.30.9.40.9.5
Show 45 moreShow less
0.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-nltk
Mageia:8
before 3.6.6-1.mga8
3.6.6-1.mga8
python-regex
Mageia:8
before 2022.9.13-1.mga8
2022.9.13-1.mga8
nltk
Ubuntu: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
nltk
Ubuntu: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
nltk
Ubuntu: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
Affected packages
PackageAffectedFixed
nltk
Ubuntu:22.04:LTS
before 3.6.5-1, plus listed versions
3.5-1
3.6.5-1
python-nltk
SUSE:Package Hub 15 SP2
From an advisory covering 2 CVEs
before 3.7-bp152.3.3.1
3.7-bp152.3.3.1
python-nltk
openSUSE:Tumbleweed
before 3.7-1.1
3.7-1.1
python-nltk
openSUSE:Tumbleweed
before 3.9.1-2.4
3.9.1-2.4

History

History
RecordedChangedSources
affected, facts
aliasesEUVD
first indexedCVE 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

Show 13 moreShow less
This page doesn't list everything

Left out here: 2 versions and the rest of 1 source description. The JSON record has them.

MoveEnter Open