Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify application exposing NLTK XML parsing
-
DeliveryCraft nested entity expansion payload
-
ExploitSubmit payload via accessible input channel
-
Executionxml.etree.ElementTree expands entities recursively
-
PersistMemory exhausted in NLTK process
-
ImpactDenial of service achieved
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A02:2025 - Security Misconfiguration
ASVS 5.0
V13 - Configuration XML entity recursion limits
|
| Exploitation Conditions | Exploitation requires that attacker-controlled or untrusted XML data reaches one of NLTK's internal modules that invoke xml.etree.ElementTree for parsing - versions prior to 3.10.3 only. The CVSS 4.0 vector (PR:N/UI:N/AV:N/AC:L/AT:N) confirms no authentication, no user interaction, and no special attack preconditions are needed once the XML input pathway is reachable. The primary limiting factor is deployment context: NLTK is overwhelmingly used as an offline library in research and data processing pipelines rather than as a network-exposed service, so the XML-parsing paths are frequently never reachable from an untrusted network. Deployments that wrap NLTK in a web API, process third-party XML feeds, or accept user-uploaded corpus files are at materially higher risk. No platform-specific configuration is required to be vulnerable; the flaw is in the default parsing behavior across all supported platforms. |
| Impact | The CVSS 4.0 vector AV:N/AC:L/AT:N/PR:N/UI:N/VA:H yields a score of 8.7, reflecting a remotely exploitable, unauthenticated, low-complexity DoS with high availability impact on the vulnerable system. The attack technique is generic and well-understood, requiring no vulnerability-specific research to weaponize. However, real-world risk is moderated by NLTK's typical deployment profile: it is primarily a library used in NLP research pipelines, data science notebooks, and batch processing workflows - not a public-facing network service. Exploitation therefore requires an application to pipe untrusted or attacker-controlled XML through NLTK's affected parsing modules. No CISA KEV listing and no public PoC are present in the available data, suggesting exploitation has not been observed at scale. EPSS data was not supplied. The combination of a straightforward attack class and an 8.7 CVSS score warrants prompt patching, but the realistic blast radius is constrained to deployments that expose NLTK's XML-parsing paths to external input. |
| Exploit ScenarioDerived | An attacker identifies an application that accepts user-supplied XML data and routes it through an NLTK module for processing. They submit a classic Billion Laughs payload - a document with a small DTD section defining a chain of entities each referencing the previous, starting from a few hundred bytes - against the endpoint. When NLTK's xml.etree.ElementTree parser processes the document, entity expansion consumes memory exponentially, causing the worker process or host to exhaust available RAM and become unresponsive, denying service to legitimate users. No CVE-specific public PoC is required, as the Billion Laughs payload structure is extensively documented and reproducible from first principles. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 25, 2026
XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of service by submitting crafted XML payloads with nested entity declarations that expand exponentially in memory. Multiple NLTK modules rely on Python's xml.etree.ElementTree parser, which honors DTD entity definitions, making them susceptible to this class of attack. No public exploit code has been identified at time of analysis, though the attack technique is universally documented and trivially constructable.
RemediationAI
Upgrade NLTK to version 3.10.3 or later, which is the vendor-released patch per the description. The authoritative advisory is at https://github.com/nltk/nltk/security/advisories/GHSA-97qj-x29f-37w7, and additional context is available at https://www.vulncheck.com/advisories/nltk-before-entity-expansion-dos-via-elementtree. If an immediate upgrade is not possible, the most actionable compensating control is to pre-filter XML input before it reaches NLTK: reject any document whose raw bytes contain a DOCTYPE declaration, which prevents entity definitions from being present at all - note this will also reject legitimate DTD-bearing documents, which may break some data pipelines. A second option is to wrap NLTK's XML-consuming functions with resource limits (memory cgroups or process ulimits) so that runaway expansion is killed before it exhausts host memory, though this introduces process instability as a trade-off. Restricting NLTK's XML-parsing modules to internally generated or fully trusted XML sources eliminates exposure without code changes.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause is CWE-776 (Improper Restriction of Recursive Entity References in DTDs), colloquially known as the 'Billion Laughs' or XML Entity Expansion attack. Python's built-in xml.etree.ElementTree parser resolves entity references defined within XML Document Type Definitions (DTDs) without imposing expansion depth or size limits. NLTK, identified by CPE cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*, uses this parser across multiple internal modules for XML processing. A malicious document can define a small set of entities that each reference others in a cascading chain, so a payload of a few hundred bytes expands to megabytes or gigabytes of in-memory data during parsing. The safe remedy is to use a hardened parser such as defusedxml, which explicitly blocks DTD processing.
Know when Nltk gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network-reachable XML parser requires no authentication; only availability impacted via memory exhaustion; scope unchanged as impact is confined to the vulnerable process.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
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.
Blast Radius
ecosystem impact- 6,216 pypi packages depend on nltk (3,092 direct, 3,204 indirect)
Ecosystem-wide dependent count for version 3.10.3.
Executive ViewAI
NLTK versions before 3.10.3 are vulnerable to XML Entity Expansion (Billion Laughs) denial-of-service attacks that allow unauthenticated remote attackers to exhaust server memory and disrupt service availability. Any organization running NLTK for natural language processing or XML analysis-particularly applications exposed to untrusted input-faces immediate risk of service outages. The absence of a vendor patch makes immediate compensating controls essential.
No vendor-released patch identified at time of analysis. Interim mitigations: disable DTD entity expansion via defusedxml library or ElementTree secure parsing; restrict XML input acceptance to authenticated internal sources; implement parser timeout and memory limits to prevent runaway processing; deploy WAF detection rules for suspicious entity nesting patterns; apply network segmentation to limit blast radius of DoS events; establish monitoring alerts for abnormal CPU and memory consumption during XML operations.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Related Vulnerabilities in NLTK Unsafe Deserialization and SSRF Flaws
View all 4Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p
Arbitrary code execution in the NLTK (Natural Language Toolkit) Python library affects all versions through its data dow
StreamBackedCorpusView in NLTK before 3.10.0 allows arbitrary local file reads by calling Python's builtins.open() direc
Symlink-based path traversal in NLTK's FramenetCorpusReader before version 3.10.2 permits attackers with write access to
Unbounded recursion in NLTK's JSONTaggedDecoder.decode_obj() (nltk/jsontags.py) allows unauthenticated remote attackers
Path traversal and pickle deserialization protections in NLTK before 3.10.0 are effectively disabled by default - pathse
Symlink escape in NLTK's CorpusReader.open() allows local attackers to read arbitrary files outside the designated corpu
Path traversal in NLTK's FramenetCorpusReader and NKJPCorpusReader (all versions before 3.10.0) enables unauthenticated
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research a
nltk is vulnerable to Inefficient Regular Expression Complexity. Rated high severity (CVSS 7.5), this vulnerability is r
EUVD-2026-65227
GHSA-97qj-x29f-37w7
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB