CVE-2026-78681

NLTK before 3.10.3 Entity Expansion DoS via ElementTree

Published Aug 25, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

NLTK versions earlier than 3.10.3 use the standard xml.etree.ElementTree parser to process XML documents, and this parser honors entity declarations in the document DTD. An attacker can craft a payload with deeply nested entity declarations that enlarge a small number of bytes into many megabytes, exhausting the memory allocated for parsing and causing a denial of service. This flaw is an example of improper handling of XML entity expansions (CWE‑776) that compromises availability for any application that uses the vulnerable library.

Affected Systems

The vulnerable product is the Python NLTK library distributed under the nltk namespace. All releases prior to 3.10.3, regardless of sub‑version, contain the affected XML parsing code and are therefore susceptible to exploitation in any environment where the library is imported or instantiated.

Risk and Exploitability

The CVSS score of 8.7 classifies this as a high‑severity vulnerability. EPSS information is not available, and the vulnerability is not listed in CISA KEV. The likely attack vector is that an attacker supplies a specially crafted XML document to any component that invokes NLTK’s XML parsing functions. Based on the description, it is inferred that a remote attacker could deliver the payload through an API endpoint or form that accepts XML input, whereas a local attacker could trigger the denial by executing a malicious script or feeding a crafted file to a command‑line tool that uses NLTK.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the NLTK library to version 3.10.3 or later.
  • Configure the XML parser to disable DTD entity processing by setting ElementTree’s resolve_entities option to False or by switching to a parser that omits entity resolution.
  • Add input validation or size limits on XML payloads before they reach the parser to reduce the chance of resource exhaustion.

Generated by OpenCVE AI on August 25, 2026 at 04:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-97qj-x29f-37w7 NLTK: Entity-expansion DoS (billion laughs) via remaining raw ElementTree parses
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title NLTK before 3.10.3 Entity Expansion DoS via ElementTree
First Time appeared Nltk
Nltk nltk
Weaknesses CWE-776
CPEs cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*
Vendors & Products Nltk
Nltk nltk
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-776

    Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Aug 26, 2026, 4:12 PM
Reserved
Aug 25, 2026, 1:17 AM
Status
Analyzed
Published
Aug 25, 2026, 2:16 AM
Modified
Oct 12, 2026, 9:10 PM