CVE-2026-72818
JSON

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 packageVersionsReported by
nltkbefore 3.10.1
Not affected: 3.10.1
CVE List
nltk (PyPI)before 3.10.1GitHub Advisory Database, PyPA Advisory Database

All scores

VulnCheck8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
VulnCheck7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubhigh CVSS:4.0CVSS: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 Database7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS: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

CWE-1333

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

Sources

SourceRecordLicence
CVE ListCVE-2026-72818 changed 2026-09-24CVE Terms of Use
GitHub Advisory DatabaseGHSA-qx2g-xrx7-vfh8 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-72818 changed 2026-10-26Public domain
PyPA Advisory DatabasePYSEC-2026-3870 changed 2026-09-10CC-BY-4.0