Skip to main content

NLTK CVE-2026-78681

| EUVDEUVD-2026-65227 HIGH
Improper Restriction of Recursive Entity References in DTDs (CWE-776)
2026-08-25 VulnCheck GHSA-97qj-x29f-37w7 GHSA-jx89-3qg8-p2mr PYSEC-2026-3748
8.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify application exposing NLTK XML parsing
  2. Delivery
    Craft nested entity expansion payload
  3. Exploit
    Submit payload via accessible input channel
  4. Execution
    xml.etree.ElementTree expands entities recursively
  5. Persist
    Memory exhausted in NLTK process
  6. Impact
    Denial 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

nltk 0 <3.10.3

Affected Packages

pypi nltk fix: 3.10.3

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

Vendor (VulnCheck) PRIMARY 8.7 HIGH
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
vuln.today AI 7.5 HIGH

Network-reachable XML parser requires no authentication; only availability impacted via memory exhaustion; scope unchanged as impact is confined to the vulnerable process.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 25, 2026 - 03:16 EUVD
CVE Published
Aug 25, 2026 - 01:30 cve.org
HIGH 8.7

DescriptionCVE.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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 6,216 pypi packages depend on nltk (3,092 direct, 3,204 indirect)

Ecosystem-wide dependent count for version 3.10.3.

Executive ViewAI

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.3%
Top 80% exploitable
Prevalence
Medium
popular Python NLP library in research and data science
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

64
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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 4

More in Nltk

View all
CVE-2026-79657 CRITICAL POC
9.3 Aug 25

Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p

CVE-2025-14009 HIGH POC
8.8 Feb 18

Arbitrary code execution in the NLTK (Natural Language Toolkit) Python library affects all versions through its data dow

CVE-2026-63312 HIGH POC
8.7 Aug 22

StreamBackedCorpusView in NLTK before 3.10.0 allows arbitrary local file reads by calling Python's builtins.open() direc

CVE-2026-62384 HIGH POC
8.7 Aug 22

Symlink-based path traversal in NLTK's FramenetCorpusReader before version 3.10.2 permits attackers with write access to

CVE-2026-66393 HIGH POC
8.7 Aug 22

Unbounded recursion in NLTK's JSONTaggedDecoder.decode_obj() (nltk/jsontags.py) allows unauthenticated remote attackers

CVE-2026-62388 HIGH POC
8.7 Aug 22

Path traversal and pickle deserialization protections in NLTK before 3.10.0 are effectively disabled by default - pathse

CVE-2026-70626 HIGH POC
8.6 Aug 22

Symlink escape in NLTK's CorpusReader.open() allows local attackers to read arbitrary files outside the designated corpu

CVE-2026-62385 HIGH POC
8.2 Aug 22

Path traversal in NLTK's FramenetCorpusReader and NKJPCorpusReader (all versions before 3.10.0) enables unauthenticated

CVE-2021-43854 HIGH POC
7.5 Dec 23

NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research a

CVE-2021-3828 HIGH POC
7.5 Sep 27

nltk is vulnerable to Inefficient Regular Expression Complexity. Rated high severity (CVSS 7.5), this vulnerability is r

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy