# CVE-2026-72818: NLTK TweetTokenizer URL Pattern Backtracks Catastrophically on Naked-Domain-Like Input

- Severity: High 8.7 (CVSS:4.0, scored by VulnCheck) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.51%, higher than 44% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-08-20T21:57:34.230Z
- Modified: 2026-10-26T10:10:00.140Z
- Also known as: GHSA-qx2g-xrx7-vfh8, PYSEC-2026-3870
- Weaknesses: CWE-1333
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: VulnCheck

## 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.

(As written by CVE List.)

## Affected

- nltk: before 3.10.1 (not affected: 3.10.1)
- nltk (PyPI): before 3.10.1

## Every score

- VulnCheck: CVSS:4.0 8.7 High `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: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 High `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: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: 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`

## 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

- CVE List: [CVE-2026-72818](https://www.cve.org/CVERecord?id=CVE-2026-72818), CVE Terms of Use, modified 2026-09-24
- GitHub Advisory Database: [GHSA-qx2g-xrx7-vfh8](https://github.com/advisories/GHSA-qx2g-xrx7-vfh8), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-72818](https://nvd.nist.gov/vuln/detail/CVE-2026-72818), Public domain, modified 2026-10-26
- PyPA Advisory Database: [PYSEC-2026-3870](https://osv.dev/vulnerability/PYSEC-2026-3870), CC-BY-4.0, modified 2026-09-10

---

Page: https://cve.day/CVE-2026-72818 · Whole record: https://cve.day/CVE-2026-72818.json · Rebuilt by cve.day 2026-11-25T22:59:34.746Z
