CVE-2026-81725
PoC massRegular Expression DoS (ReDoS) in NLTK Pl196xCorpusReader before 3.10.3
NLTK before 3.10.3 contains a regular expression denial-of-service (ReDoS) vulnerability in the Pl196xCorpusReader, where lazy regex patterns in the read_block method cause quadratic CPU consumption when parsing malformed TEI blocks containing many unmatched opening tags. An attacker triggers the flaw by supplying attacker-controlled or untrusted corpus content that an application parses through public APIs such as words() or tagged_words(), forcing repeated rescans and near-quadratic runtime growth with input size. The attacker gains degradation of service — CPU exhaustion on the parsing process — with a low availability impact and no confidentiality or integrity impact, consistent with the CVSS 4.0 medium score of 6.3. Any Python application, notebook, or service running NLTK below 3.10.3 that parses untrusted TEI/corpus data through the affected reader is affected. There are no confirmed reports of in-the-wild exploitation: the flaw is not in CISA KEV, EPSS estimates only a 0.2% probability of exploitation within 30 days, and the sole public reference is the NLTK GitHub security advisory (GHSA-8mpw-7fpc-4gqj) with a proof of concept.
What to do: Upgrade NLTK to version 3.10.3 or later via pip. If upgrading is not immediately possible, avoid parsing untrusted or user-supplied TEI/corpus files with words(), tagged_words(), or other Pl196xCorpusReader APIs, or restrict and validate the size and structure of inputs. Audit dependency pins and environment lockfiles for nltk versions below 3.10.3, since the library is commonly pulled in transitively by NLP pipelines.
| NLTK (Natural Language Toolkit) | all versions before 3.10.3 (pip ecosystem; fixed in 3.10.3) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
NLTK before 3.10.3 contains a regular expression denial of service vulnerability in Pl196xCorpusReader that allows attackers to cause quadratic CPU consumption by supplying malformed TEI blocks with many unmatched opening tags. Attackers can exploit lazy regex patterns in the read_block method through public APIs like words() and tagged_words() to force repeated rescans and achieve near-quadratic runtime growth.
- Vendors
- nltk
- Products
- nltk
- Ecosystems
- pip
- Weakness
- CWE-400
- Vector
- CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/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-8mpw-7fpc-4gqj (medium)
In the news0 stories
No ingested article mentions this CVE yet.