CVE-2026-81725 in NLTKinfo

Summary

by MITRE • 08/27/2026

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.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 08/27/2026

The vulnerability identified within NLTK versions prior to 3.10.3 represents a significant regular expression denial of service, commonly referred to as ReDoS, located specifically in the Pl196xCorpusReader component. This flaw arises from the implementation of lazy regex patterns used during the parsing process for Text Encoding Initiative blocks. When an attacker supplies malformed TEI content characterized by numerous unmatched opening tags, the underlying regular expression engine is forced into a state of catastrophic backtracking. The read_block method, which processes these input streams, fails to efficiently handle invalid structures, leading to repeated rescans of the same data segments as the regex attempts various combinations to find a match that does not exist due to the structural imbalance in the tags.

From an operational perspective, this vulnerability allows remote or local attackers to induce quadratic CPU consumption on the affected system. The runtime complexity grows exponentially relative to the length and complexity of the malformed input, effectively creating a denial of service condition without requiring any authentication if the vulnerable API endpoints are exposed publicly. Public APIs such as words() and tagged_words(), which rely on the read_block method for data extraction, serve as direct vectors for exploitation. By submitting carefully crafted inputs with many unmatched opening tags, an attacker can consume excessive computational resources, potentially causing system instability, service degradation, or complete unavailability of natural language processing services that depend on NLTK.

This vulnerability aligns with CWE-400, which describes Uncontrolled Resource Consumption, specifically manifesting as a Regular Expression Denial of Service. In the context of the MITRE ATT&CK framework, this behavior corresponds to techniques associated with resource exhaustion attacks, where adversaries aim to disrupt service availability by overwhelming system resources rather than compromising data integrity or confidentiality directly. The lack of input validation and efficient regex handling in older versions of NLTK highlights a common pitfall in text processing libraries that must handle potentially untrusted or malformed structured text formats like TEI.

Mitigation for this issue requires upgrading the Natural Language Toolkit to version 3.10.3 or later, where the regular expression patterns have been optimized and input validation mechanisms strengthened to prevent catastrophic backtracking. For systems unable to upgrade immediately, implementing strict input sanitization is critical. This includes validating that TEI blocks are well-formed before passing them to NLTK readers, limiting the size of inputs processed by words() and tagged_words(), or placing these services behind a web application firewall capable of detecting and blocking regex-based denial of service patterns. Additionally, setting timeouts on text processing operations can help mitigate the impact of such attacks in production environments where immediate patching is not feasible.

Responsible

VulnCheck

Reservation

08/27/2026

Disclosure

08/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!