CVE-2026-80206: NLTK 3.10.2 Regular Expression Denial of Service via tgrep
NLTK before 3.10.3 contains a regular expression denial of service (ReDoS) vulnerability in the tgrep module. The tgrepnodeaction function compiles user-supplied regular expressions embedded in /regex/ pattern nodes and executes them via re.search against tree node labels without any validation or timeout. An attacker who controls the tgrep pattern (e.g., via tgreppositions() or tgrepcompile() exposed to external input) can supply a pattern that triggers catastrophic backtracking, causing indefinite CPU saturation that blocks the Python process.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using NLTK's tgrep functionality are exposed if untrusted users can influence tgrep patterns passed through interfaces such as tgrep_positions() or tgrep_compile(). The vulnerable path applies regular expressions from /regex/ pattern nodes to tree node labels.
What does an attacker need to exploit it?
An attacker needs the ability to provide or control a tgrep pattern containing a regular expression. No authentication or user interaction is required according to the supplied vector, but crafting a pattern that causes catastrophic backtracking has high attack complexity.
Are default deployments affected?
The provided information identifies exposure only where externally controlled input reaches tgrep pattern compilation or execution. It does not establish that a default NLTK deployment exposes such an input path.
What is the impact of successful exploitation?
A malicious regular expression can cause indefinite CPU saturation in the Python process while re.search evaluates it against tree node labels. This is an availability impact; no confidentiality or integrity impact is identified.
What can be done if upgrading is not immediately possible?
Do not allow untrusted parties to supply tgrep patterns, particularly /regex/ pattern nodes, to tgrep_positions() or tgrep_compile(). Restrict pattern inputs to trusted, validated values to prevent attacker-controlled expressions from reaching re.search.