CVE-2026-81725: NLTK Pl196xCorpusReader quadratic ReDoS on malformed TEI blocks

CVE-2026-81725 · Severity: medium · CVSS 4 · Published 2026-08-27

NLTK's Pl196xCorpusReader is a component used to parse linguistic corpus files in TEI (Text Encoding Initiative) format. When processing malformed corpus files with many unmatched XML tags, an attacker can cause the parser to enter a denial-of-service condition where CPU usage grows quadratically—doubling the malformed tags roughly quadruples the parsing time. This allows an attacker to consume significant server resources and stall legitimate application processing by supplying a specially crafted corpus file.

Technologies: nltk (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-81725 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-81725 being exploited in the wild.
How severe is CVE-2026-81725?
Medium severity, with a CVSS score of 4, published 27 August 2026.
Which products and versions are affected?
nltk (PyPI) <= 3.10.2, ECOSYSTEM:introduced=0,fixed=3.10.3.
Is there a fix for CVE-2026-81725?
Yes. nltk (PyPI): upgrade to 3.10.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-81725 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-81725?
Check whether you run nltk (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • nltk (PyPI): upgrade to 3.10.3 or later
    pip install "nltk>=3.10.3"

Technical details

The vulnerability is a regular-expression denial of service (ReDoS) affecting nltk.corpus.reader.pl196x.TEICorpusView.read_block and Pl196xCorpusReader public methods (words(), tagged_words()). The root cause is the use of lazy regex quantifiers (.*?) that scan entire TEI blocks without bounds. When processing malformed XML-like content with many unmatched opening tags but no closing tags, the regex engine rescans from each opening-tag position toward the end of the block, failing repeatedly and restarting. This creates quadratic time complexity—approximately four-fold runtime increase per doubling of malformed tags. An attacker can exploit this by supplying a corpus file with a valid header followed by a text block containing many unclosed opening tags. No authentication or special privileges are required; the application need only parse attacker-controlled corpus files through public APIs. The patch (v3.10.3+) replaces the whole-block lazy-regex parser with a linear parser or bounded tokenizer.

Affected products

  • NLTK NLTK <= 3.10.2

Identifiers

  • CVE-2026-81725
  • GHSA-8mpw-7fpc-4gqj
  • PYSEC-2026-3752

Timeline

  • 2026-08-12: disclosed: Initial GitHub advisory publication
  • 2026-09-08: advisory: Advisory published to GitHub Advisory Database
  • 2026-08-12: patched: Fix committed (v3.10.3+)

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.