Loading advisory.
Loading advisory.
NLTK: Pl196xCorpusReader has quadratic ReDoS on malformed TEI blocks
Pl196xCorpusReader still parses whole TEI blocks with multiple lazy regexes over attacker-controlled text. A malformed file with many opening tags and no matching closing tags forces repeated rescans and produces quadratic CPU growth in public reader APIs.
Published 2026-08-27 14:51 UTC · Modified 2026-09-08 20:45 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| nltk | PyPI | < 3.10.3 versions 0.8, 0.9, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 2.0.1, 2.0.1rc1, 2.0.1rc2-git, 2.0.1rc3, 2.0.1rc4, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0b4, 2.0b5 and 48 more | 3.10.3 | pip install --upgrade 'nltk>=3.10.3' |
Pl196xCorpusReader still parses whole TEI blocks with multiple lazy regexes over attacker-controlled text. A malformed file with many opening tags and no matching closing tags forces repeated rescans and produces quadratic CPU growth in public reader APIs.
Vulnerability type: Regular-expression denial of service
Affected component: nltk.corpus.reader.pl196x.TEICorpusView.read_block and Pl196xCorpusReader public methods
Affected versions: Published 3.9.4 and current source v3.10.0-rc2 both reproduced.
Patched versions: Not yet patched
Root cause: Lazy .*? whole-block regexes rescan untrusted XML-like blocks from each opening-tag position.
The parser uses regexes for paragraphs, sentences, and word tags across the whole <text> block. When the attacker supplies many unmatched opening tags, each attempt scans toward the end of the block and fails, then restarts from the next opening tag. There is near four-times runtime growth each time the number of malformed <p> tags doubled, through normal public calls such as words() and tagged_words().
Preconditions
The application parses attacker-influenced PL196X or TEI-like corpus files through public reader APIs.
Steps
Create a corpus file with a valid header followed by a <text> block that contains many opening tags and no matching closing tags.
Instantiate Pl196xCorpusReader on that corpus.
Call words() or tagged_words() and measure elapsed time as the malformed tag count doubles.
Observe near quadratic growth instead of near-linear behavior.
Minimal reproducible excerpt
size=1000 0.014s
size=2000 0.057s
size=4000 0.231s
size=8000 0.927sA consumer that accepts attacker-influenced corpus files can be forced into heavy CPU use and parser-thread stalling before the application concludes the input contains no valid content.
Replace the whole-block lazy-regex parser with a linear parser or bounded tokenizer, and add regression tests that assert near-linear behavior on malformed inputs with many unmatched tags.
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
One EPSS score on record: 0.004 on 2026-11-24.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.004 | first score | v2026.06.15 |