8.7high
NLTK TweetTokenizer URL Pattern Backtracks Catastrophically on Naked-Domain-Like Input
- Severity
- 8.7high CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.51% (higher than 44% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- GHSA-qx2g-xrx7-vfh8PYSEC-2026-3870
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| nltk | before 3.10.1 Not affected: 3.10.1 | CVE List |
| nltk (PyPI) | before 3.10.1 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| VulnCheck | 8.7high CVSS:4.0 | 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 |
| VulnCheck | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | high CVSS:4.0 | 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 |
| PyPA Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | Not scored CVSS:4.0 | 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 |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
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.
NVD (es)
La expresión regular URLS en nltk/tokenize/casual.py, compilada en TweetTokenizer.WORD_RE y aplicada por TweetTokenizer.tokenize, contiene una rama de dominio ’desnudo’ cuyo prefijo de etiqueta de dominio [a-z0-9]+(?:[.\-][a-z0-9]+)* es ilimitado. La entrada que consiste en muchos separadores de etiquetas alternos puede ser particionada de exponencialmente muchas maneras, y debido a que la rama también requiere un dominio de nivel superior final que dicha entrada nunca proporciona, el motor explora esas particiones antes de fallar en cada desplazamiento. Unos pocos kilobytes de entrada, por lo tanto, consume de segundos a minutos de CPU de un solo hilo, y la sustitución HANG_RE realizada antes de la coincidencia no colapsa el patrón. TweetTokenizer está diseñado para tokenizar texto no confiable de redes sociales, por lo que cualquier servicio que lo aplique, o el casual_tokenize a nivel de módulo, a texto enviado puede ser paralizado por solicitud sin autenticación. La versión 3.10.1 limita la repetición de etiquetas.
References
| https://github.com/nltk/nltk/issues/3704 | exploit, issue-tracking, web | |
| https://github.com/nltk/nltk/blob/3.9.4/nltk/tokenize/casual.py | technical-description, web | |
| https://github.com/nltk/nltk/releases/tag/v3.10.1 | release-notes, web | |
| https://github.com/nltk/nltk | package, product | |
| https://www.vulncheck.com/advisories/nltk-tweettokenizer-url-pattern-backtracks-catastrophically-on-naked-domain-like-input | third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-72818 | advisory | |
| https://github.com/nltk/nltk/pull/3701 | web | |
| https://github.com/nltk/nltk/commit/e092ed52eccae642304448bffc8d23cb301f85c1 | web | |
| https://pypi.org/project/nltk | package | |
| https://github.com/advisories/GHSA-qx2g-xrx7-vfh8 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-72818 changed 2026-09-24 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-qx2g-xrx7-vfh8 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-72818 changed 2026-10-26 | Public domain |
| PyPA Advisory Database | PYSEC-2026-3870 changed 2026-09-10 | CC-BY-4.0 |