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

Source: https://junglewise.ai/threats/cve-2026-81725-nltk-pl196xcorpusreader-quadratic-redos-on-malformed-tei-blocks  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-27. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/nltk). Vendors: [PyPI](https://junglewise.ai/threats/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

  ```sh
  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

- [https://github.com/nltk/nltk/security/advisories/GHSA-8mpw-7fpc-4gqj](https://github.com/nltk/nltk/security/advisories/GHSA-8mpw-7fpc-4gqj)
- [https://github.com/nltk/nltk/commit/7808692d451b962711005d954859bb83aabcf8fa](https://github.com/nltk/nltk/commit/7808692d451b962711005d954859bb83aabcf8fa)
- [https://github.com/nltk/nltk/releases/tag/v3.10.3](https://github.com/nltk/nltk/releases/tag/v3.10.3)
- [https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3752.yaml](https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3752.yaml)
- [https://www.vulncheck.com/advisories/nltk-before-3.10.3-regular-expression-denial-of-service-via-pl196xcorpusreader](https://www.vulncheck.com/advisories/nltk-before-3.10.3-regular-expression-denial-of-service-via-pl196xcorpusreader)

## Related threats

- [NLTK WekaClassifier path traversal in model validation](https://junglewise.ai/threats/cve-2026-109956-nltk-through-3-10-3-contains-a-path-traversal-vulnerability-in)
- [NLTK RecursiveDescentParser uncontrolled recursion denial of service](https://junglewise.ai/threats/cve-2026-12876-nltk-recursivedescentparser-uncontrolled-recursion-denial-of)
- [NLTK tgrep regular expression denial of service](https://junglewise.ai/threats/nltk-tgrep-regular-expression-denial-of-service-02fca1b2)
- [NLTK Downloader hardlink filesystem containment bypass](https://junglewise.ai/threats/nltk-downloader-hardlink-filesystem-containment-bypass-522cb97d)
- [NLTK Pl196xCorpusReader quadratic ReDoS on malformed TEI blocks](https://junglewise.ai/threats/nltk-pl196xcorpusreader-quadratic-redos-on-malformed-tei-blocks-8473e6ef)
