CVE-2026-72818 — Vulnerability in nltk — CVE Details
NLTK TweetTokenizer vulnerable to denial of service through catastrophic regex backtracking
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.
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 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).
| Package | Fixed 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.
- CWE-1333
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-72818ADVISORY
- https://github.com/nltk/nltk/issues/3704WEB
- https://github.com/nltk/nltk/pull/3701WEB
- https://github.com/nltk/nltk/commit/e092ed52eccae642304448bffc8d23cb301f85c1WEB
- https://github.com/nltk/nltkPACKAGE
- https://github.com/nltk/nltk/blob/3.9.4/nltk/tokenize/casual.pyWEB
- https://github.com/nltk/nltk/releases/tag/v3.10.1WEB
- https://www.vulncheck.com/advisories/nltk-tweettokenizer-url-pattern-backtracks-catastrophically-on-naked-domain-like-inputWEB
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
Significant impact if exploited, or exploitable with modest effort.
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
Related CVEs
- CVE-2026-70626HIGH
- CVE-2026-126299HIGH
NLTK: Quadratic-time CPU denial of service in CCG lexicon parser (fromstring) on wide bracket bodies and operator chains
- CVE-2026-126303HIGH
NLTK: Unbounded CPU consumption in SteppingRecursiveDescentParser.parse() with ambiguous or self-embedding grammars
- CVE-2026-81726HIGH
NLTK: Model-artifact APIs bypass pathsec and touch files outside allowed roots
- CVE-2026-70626HIGH
NLTK: Symlink escape in CorpusReader allows arbitrary local file read outside the corpus root
- CVE-2026-129222HIGH
Natural Language Toolkit (NLTK): Uncontrolled recursion (crash DoS) in DependencyGraph.tree()/triples()
- CVE-2026-65915MEDIUM
- CVE-2026-66393MEDIUM
Natural Language Toolkit (NLTK) has unbounded recursion in JSONTaggedDecoder.decode_obj() may cause DoS