ZeroHour

CVE-2026-80206

PoC mass

ReDoS in NLTK tgrep module via unvalidated user-supplied regular expressions

CVSS 4.0
8.2 high
EPSS
<1%p18
Published
()
Modified
AI analysis

CVE-2026-80206 is a regular expression denial-of-service flaw (CWE-1333) in the tgrep module of NLTK, the widely used Python natural language processing toolkit distributed via PyPI/pip. When a tgrep query contains a '/regex/' node literal, _tgrep_node_action() in nltk/tgrep.py compiles the caller-controlled pattern with re.compile() without any validation or timeout and applies it against every matching tree node label, so a pathological pattern (e.g. a nested quantifier matched against a label lacking the expected character) triggers catastrophic backtracking. An attacker who can supply a tgrep pattern to tgrep_positions() or tgrep_compile() can hang the Python process indefinitely with a single request, achieving full denial of service; the CVSS 4.0 score of 8.2 reflects availability-only impact with no confidentiality or integrity effect. Only applications that pass untrusted input into the tgrep API are affected (most NLTK users never invoke tgrep), and the advisory data confirms NLTK 3.10.2 exhibits the flaw without stating a broader affected range or a fixed version. Exploitation is not currently observed: EPSS assigns a 0.3% 30-day exploitation probability (18th percentile), the flaw is not in CISA KEV, and no public exploit is known beyond the PoC included in the advisory.

What to do: No patched release is named in the available data, so monitor the NLTK project (PyPI/GitHub) for an updated version fixing CVE-2026-80206 and upgrade when it is published. In the meantime, treat '/.../' node literals in tgrep patterns as untrusted input: validate or restrict embedded regular expressions (especially nested quantifiers), avoid passing user-supplied strings directly to tgrep_positions() or tgrep_compile(), and execute tgrep queries in a subprocess or worker with a timeout so a catastrophic-backtracking pattern cannot hang the application.

Affected
NLTK project NLTK (nltk Python package, PyPI/pip ecosystem)Affected range not specified in the advisory data; NLTK 3.10.2 confirmed affected by testing, no fixed version stated
Estimated exposure
massmillions of nltk installs via PyPI (roughly 10M+ monthly PyPI downloads), but plausibly exploitable deployments (tgrep fed untrusted patterns) likely only in… — NLTK is one of the most-downloaded packages on PyPI with a very large installed base across academic and production Python NLP stacks, but no public scan data identifies services exposing the niche tgrep module to untrusted input, so the…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

NLTK before 3.10.3 contains a regular expression denial of service (ReDoS) vulnerability in the tgrep module. The _tgrep_node_action 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 tgrep_positions() or tgrep_compile() exposed to external input) can supply a pattern that triggers catastrophic backtracking, causing indefinite CPU saturation that blocks the Python process.

Vendors
nltk
Products
nltk
Ecosystems
pip
Weakness
CWE-1333
Vector
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GHSA
GHSA-w3v8-gmh9-3wv7 (high)

In the news

No ingested article mentions this CVE yet.