Skip to main content

CVE-2026-72818 — Vulnerability in nltk — CVE Details

HIGH

NLTK TweetTokenizer vulnerable to denial of service through catastrophic regex backtracking

Published August 21, 2026Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.74%). Schedule for your next planned update.

Does your project use an affected nltk version?

Paste your requirements.txt to check it for CVE-2026-72818 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my requirements.txt

Summary

The URLS regular expression in nltk/tokenize/casual.py, compiled into TweetTokenizer.WORD_RE and applied by TweetTokenizer.tokenize, contains a naked-domain branch whose domain-label prefix [a-z0-9]+(?:[.-][a-z0-9]+)* is unbounded. Input consisting of many alternating label separators can be partitioned in exponentially many ways, and because the branch also requires a trailing top-level domain that such input never supplies, the engine explores those partitions before failing at each offset. A few kilobytes of input therefore consumes seconds to minutes of single-threaded CPU, and the HANG_RE substitution performed before matching does not collapse the pattern. TweetTokenizer is intended for tokenizing untrusted social-media text, so any service that applies it, or the module-level casual_tokenize, to submitted text can be stalled per request without authentication. Version 3.10.1 bounds the label repetition.

Advisory Timeline

  • First published August 21, 2026 (97 days ago).
  • Last revised September 10, 2026 — 20 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

pip
Update nltk to 3.10.1 or later
pip install "nltk>=3.10.1"

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: PyPI (1).

PackageFixed In
nltk PyPI · Affected: 0.8, 0.9, 0.9.3, 0.9.4 (+62 more)3.10.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Frequently Asked Questions

What is CVE-2026-72818?
NLTK TweetTokenizer vulnerable to denial of service through catastrophic regex backtracking. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2026-72818?
CVE-2026-72818 affects nltk. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-72818 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.74%
EPSS percentile: 50.7

This is an above-median EPSS score — 50.7% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-qx2g-xrx7-vfh8
PYSEC-2026-3870

Related CVEs

  • CVE-2026-70626
    HIGH
  • CVE-2026-126299
    HIGH

    NLTK: Quadratic-time CPU denial of service in CCG lexicon parser (fromstring) on wide bracket bodies and operator chains

  • CVE-2026-126303
    HIGH

    NLTK: Unbounded CPU consumption in SteppingRecursiveDescentParser.parse() with ambiguous or self-embedding grammars

  • CVE-2026-81726
    HIGH

    NLTK: Model-artifact APIs bypass pathsec and touch files outside allowed roots

  • CVE-2026-70626
    HIGH

    NLTK: Symlink escape in CorpusReader allows arbitrary local file read outside the corpus root

  • CVE-2026-129222
    HIGH

    Natural Language Toolkit (NLTK): Uncontrolled recursion (crash DoS) in DependencyGraph.tree()/triples()

  • CVE-2026-65915
    MEDIUM
  • CVE-2026-66393
    MEDIUM

    Natural Language Toolkit (NLTK) has unbounded recursion in JSONTaggedDecoder.decode_obj() may cause DoS

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my requirements.txt