Inefficient regular expression complexity in Natural Language Toolkit - CVE-2026-129229

 

Inefficient regular expression complexity in Natural Language Toolkit - CVE-2026-129229

Published: November 16, 2026


Vulnerability identifier: #VU166230
CSH Severity: Medium
CVSS v4: 8.7 [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]
CVE-ID: CVE-2026-129229
CWE-ID: CWE-1333
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to exhaust CPU resources and cause a denial of service.

The vulnerability exists due to unbounded quadratic regular-expression compilation in NLTK search and tokenizer functions when processing caller-controlled patterns without group-count limits, outside the matching timeout. A remote attacker can submit a pattern such as "()" * 25000 through an application exposing Text.findall(), TokenSearcher.findall(), or RegexpTokenizer to trigger expensive synchronous compilation and exhaust CPU cores through repeated or concurrent requests.


Affected software

Natural Language Toolkit

How to mitigate CVE-2026-129229

Install security update from vendor's website.

Natural Language Toolkit - update to 3.10.4

External References

Related Security Bulletins