High severity · published Aug 20, 2026
CVE-2026-72818
NLTK TweetTokenizer URL Pattern Backtracks Catastrophically on Naked-Domain-Like Input
7.5
CVSS
0.7%
EPSS
No
On KEV
Description
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.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
None
Integrity
None
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.7% · higher than 54% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
NL
nltk · nltk
before 3.10.1 · source: vendor
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-72818
CVE.org
https://www.cve.org/CVERecord?id=CVE-2026-72818
github.com
https://github.com/nltk/nltk
github.com
https://github.com/nltk/nltk/blob/3.9.4/nltk/tokenize/casual.py
github.com
https://github.com/nltk/nltk/issues/3704
github.com
https://github.com/nltk/nltk/releases/tag/v3.10.1
www.vulncheck.com
https://www.vulncheck.com/advisories/nltk-tweettokenizer-url-pattern-backtracks-catastrophically-on-naked-domain-like-input
More from nltk
10.0
CVE-2026-0848
Arbitrary Code Execution in NLTK StanfordSegmenter via Untrusted JAR Loading
9.8
CVE-2026-79675
NLTK before 3.10.3 JVM Argument Injection via Per-Call Options
9.8
CVE-2026-79657
NLTK before 3.10.3 Remote Code Execution via Unsafe Pickle Deserialization
9.6
CVE-2026-78683
NLTK before 3.10.0 Remote Code Execution via Unsafe Pickle Deserialization
8.8
CVE-2026-71513
NLTK 3.10.0 through 3.10.2 Remote Code Execution via AllowlistUnpickler Dotted-Name Bypass
