CVE-2026-78681 in NLTKinfo

Summary

by MITRE • 08/25/2026

NLTK versions before 3.10.3 use xml.etree.ElementTree to parse XML in multiple modules, which honors entity declarations in document DTDs. Attackers can craft XML payloads with nested entity declarations that expand from hundreds of bytes to megabytes in memory, causing denial of service.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 08/25/2026

The vulnerability identified in Natural Language Toolkit (NLTK) versions prior to 3.10.3 stems from the improper handling of external entities within Extensible Markup Language documents processed by the xml.etree.ElementTree module. This standard Python library is widely used for parsing XML data, but its default configuration does not disable support for Document Type Definitions that include entity declarations. When NLTK utilizes this parser to process input text or structured data containing maliciously crafted XML payloads, it inadvertently honors these external references. An attacker can construct an XML document featuring nested entity definitions designed to trigger exponential expansion during the parsing phase. This technique exploits the recursive nature of entity resolution, where a single small payload expands into significantly larger amounts of memory as the parser attempts to resolve each layer of nesting.

This specific flaw is classified under Common Weakness Enumeration CWE-776 Improper Restriction of Recursive Entity References and aligns with MITRE ATT&CK technique T1498 Network Denial of Service, specifically regarding resource exhaustion through XML processing. The operational impact of this vulnerability is primarily a denial of service condition affecting the host system or application running NLTK. As the parser processes the crafted payload, memory consumption spikes rapidly from hundreds of bytes to several megabytes in a short period. This uncontrolled allocation can lead to out-of-memory errors, causing the application to crash or become unresponsive. In environments where NLTK is used for processing user-generated content or external data sources without strict validation, this vulnerability allows remote attackers to disrupt service availability by triggering resource exhaustion attacks against the underlying infrastructure.

Mitigation strategies require immediate updates to NLTK version 3.10.3 or later, which addresses this issue by implementing safer parsing defaults that restrict recursive entity expansion. For applications unable to upgrade immediately, developers should implement input validation mechanisms that filter out XML documents containing DTDs with external entities before they reach the parser. Additionally, configuring the xml.etree.ElementTree parser to use a safe sub-class or disabling external general and parameter entities can prevent exploitation. It is also recommended to enforce strict schema validations on incoming data streams and monitor system memory usage during parsing operations to detect anomalous spikes indicative of such attacks. Ensuring that third-party libraries are kept up-to-date with security patches remains the most effective defense against these types of logic-based denial of service vulnerabilities.

Responsible

VulnCheck

Reservation

08/25/2026

Disclosure

08/25/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!