Skip to main content

NLTK CVE-2026-129232

| EUVDEUVD-2026-130477 MEDIUM
Uncontrolled Resource Consumption (CWE-400)
2026-11-19 security-advisories@github.com GHSA-cj8f-5fp3-6m88
5.3
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Supply attacker-influenced corpus XML to an XMLCorpusView reader
  2. Exploit
    Nest start tags that never match the tagspec
  3. Execution
    Force per-tag quadratic path rebuild in read_block
  4. Impact
    Exhaust a single CPU core, denying service

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application pass untrusted or attacker-influenced XML corpus data into an NLTK XMLCorpusView subclass reader - specifically the nps_chat, framenet, bnc, mte, nkjp, or semcor readers, or any custom XMLCorpusView with a concrete anchored tagspec. The attacker must control the XML body and supply deeply nested start tags whose path never completes a full match against the reader's tagspec (e.g. '<a>' x n then '</a>' x n), which keeps elt_start None and drives the per-start-tag '/'.join(context) rebuild across all n depths. No authentication, privilege, or user interaction is needed (PR:N/UI:N) once such input reaches the reader. The key limiting factor is deployment-specific: applications that only parse trusted, bundled, shallow corpus files are not realistically exposed, since real corpora are shallow (the fix caps depth at 500). There is no platform or version constraint beyond running NLTK <= 3.10.3.

Impact

This is a genuine but moderate-priority availability issue, not a high-urgency emergency. The CVSS vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L, base 5.3 MEDIUM) and the SSVC-style vuln.today decision label 'this_month' agree: unauthenticated, low-complexity, but impact is limited to availability (A:L) of a single processing worker/core with no confidentiality or integrity effect. The vuln.today 'this_month' label signals schedule-within-normal-cycle, not act_now or emergency. No CISA KEV listing and no EPSS score are provided in the input, so there is no evidence of active or at-scale exploitation; the GitHub Security Advisory (GHSA-cj8f-5fp3-6m88) includes a detailed proof-of-concept benchmark demonstrating the O(n^2) behavior, so exploitability is well established even though weaponized in-the-wild use is not. The practical risk is gated by a real deployment prerequisite not captured in the CVSS network vector: the application must actually feed untrusted or attacker-influenced XML corpus data through an XMLCorpusView subclass reader (nps_chat, framenet, bnc, mte, nkjp, semcor), which is not the default path for most NLTK consumers - so AV:N overstates reach for deployments that only parse trusted bundled corpora. Note a timeline nuance: the advisory snapshot dated 2026-09-28 marks the fix as IN PROGRESS on open PR #3895 (not yet released), while the CVE description and the version metadata state it is fixed in 3.10.4; treat 3.10.4 as the fixed release but verify the installed version, since the advisory text itself was written before that release shipped.

Exploit ScenarioDerived

An application that parses user-supplied or attacker-influenced XML corpus files through an NLTK XMLCorpusView subclass receives a crafted file containing deeply nested start tags (e.g. '<a>' repeated tens of thousands of times) whose path never matches the reader's anchored tagspec. Because read_block rebuilds the full '/'.join(context) path for every start tag as nesting depth grows, CPU cost scales quadratically, pinning one core for seconds to minutes (a ~200 KB file costs several seconds; a few-megabyte or unclosed file can hang the worker indefinitely). A public proof-of-concept benchmark demonstrating this quadratic scaling is published in the GHSA advisory; it is a reproduction/measurement script rather than a verified drop-in weaponized exploit.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.5% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Nov 19, 2026

Quadratic CPU exhaustion in NLTK's XMLCorpusView.read_block (all releases through 3.10.3) lets an attacker who can supply or influence corpus XML pin a processing worker by nesting tags deeply: the reader rebuilds the whole root-to-node path with '/'.join(context) on every start tag while it is still hunting for a tagspec match, so n nested elements cost O(n^2) pure-Python string work. The affected surface is any XMLCorpusView subclass with a concrete anchored tagspec - the nps_chat, framenet, bnc, mte, nkjp and semcor readers, or custom views - reached without authentication or user interaction (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L, 5.3), with impact limited to availability of the processing thread or process. The GitHub advisory ships a proof-of-concept reproduction with measured timings (n=32,000 nested tags ≈ 5.7 s, scaling ~3.6x per doubling, versus linear behavior for a flat negative control), so a public PoC reference exists; it is not verified as working exploit code beyond that reproduction, and there is no confirmation of active exploitation (no CISA KEV listing) at time of analysis. NLTK 3.10.4 fixes the issue by capping XML nesting depth at 500.

RemediationAI

Vendor-released patch: upgrade nltk to 3.10.4 or later (pip install --upgrade nltk), which adds MAX_XML_DEPTH = 500 in nltk/corpus/reader/xmldocs.py and makes XMLCorpusView.read_block raise ValueError('XML nesting depth exceeds MAX_XML_DEPTH') when the context stack grows past that bound; the same release reference is at https://github.com/nltk/nltk/releases/tag/v3.10.4 and the advisory at https://github.com/nltk/nltk/security/advisories/GHSA-cj8f-5fp3-6m88. Note the fix is a hard depth cap, not incremental path tracking, so it also rejects legitimately deep documents beyond 500 levels - a trade-off worth verifying against your corpus shapes before rollout. Where upgrading is not immediately possible, the documented interim mitigation is to enforce an upstream size limit on corpus XML handed to these readers and to avoid parsing untrusted or attacker-influenced corpus files through XMLCorpusView subclasses (nps_chat, framenet, bnc, mte, nkjp, semcor, or custom views); the advisory explicitly states this does not remove the quadratic behavior for inputs below the limit, so it reduces but does not eliminate the denial-of-service exposure. Isolating corpus parsing in a worker process with a CPU-time or wall-clock timeout limits the blast radius to that worker, at the cost of losing the in-process result and needing restart logic. At the time of the advisory the fix existed only on the open PR #3895 head; the released 3.10.4 artifact is the supported remediation path.

Affected VersionsENISA

nltk < 3.10.4

Affected Packages

pypi nltk fix: 3.10.4

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 flaw is an algorithmic complexity problem (CWE-400, and CWE-407 as classified in the GHSA) in NLTK's XML corpus reader, not an XML parser or entity-expansion bug. XMLCorpusView.read_block maintains a context list that is appended on each start tag and popped on each end tag; while no target element has been located (elt_start is None), it recomputes the full path string with '/'.join(context) and matches it against the reader's anchored tagspec (tagspec + '\\Z'). With a concrete tagspec such as Session/Posts/Post, a path like a/a/a/... never completes a match, so elt_start stays None for the whole file and the join runs for every start tag at depths 1..n, summing to O(n^2) pure-Python cost; the empty-element variant that rebuilds '/'.join(context) + '/' + name has the same problem. The per-call regex timeout used elsewhere in the file does not observe this cumulative string-building cost, and no depth limit, context-length bound or work budget existed in read_block. The fix commit 002bcf714 ('Bound three quadratic algorithmic-DoS vectors on untrusted input', carried in PR #3895) introduces MAX_XML_DEPTH = 500 and raises a ValueError when len(context) exceeds it; the same commit also bounds a separate O(N^2) rescan in nltk/data.py's readline/splitlines logic and adds MAX_GROUP_COUNT = 1000 to nltk/redos.py to stop compile-time quadratic blowup from patterns with huge capturing-group counts, which are distinct vectors bundled into one hardening change. A reproduction through a real SeekableUnicodeStreamReader confirms the join is the quadratic term: identical tag counts in flat form stay linear (~2x per input doubling) while nested form grows toward ~4x per doubling.

Know when Python 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 (github) PRIMARY 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
vuln.today AI 5.3 MEDIUM

Attacker-supplied corpus XML can arrive over the network with no auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is limited to CPU exhaustion of one worker, so A:L and C:N/I:N.

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

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

Lifecycle Timeline

2
Patch available
Nov 19, 2026 - 19:34 EUVD
CVE Published
Nov 19, 2026 - 17:17 cve.org
MEDIUM 5.3

DescriptionCVE.org

NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. Prior to 3.10.4, XMLCorpusView.read_block rebuilds the full root-to-node context path with "/".join(context) for every start tag while searching for a matching element. Deeply nested attacker-influenced corpus XML therefore causes quadratic pure-Python work and can pin a processing worker, resulting in denial of service. This issue is fixed in version 3.10.4.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 6,309 pypi packages depend on nltk (3,111 direct, 3,281 indirect)

Ecosystem-wide dependent count for version 3.10.4.

Threat Intelligence Overview

EPSS Score
0.5%
Top 59% exploitable
Prevalence
High
NLTK is a widely deployed Python NLP library; vulnerable untrusted-corpus-XML path is narrower
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
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.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

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