Skip to main content

NLTK CVE-2026-129231

| EUVDEUVD-2026-130491 MEDIUM
Uncontrolled Resource Consumption (CWE-400)
2026-11-19 GitHub_M GHSA-q4c8-9gwf-255x
5.3
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Upload crafted corpus file with one unterminated line
  2. Delivery
    Service feeds file to line-oriented NLTK corpus reader (encoding set)
  3. Exploit
    readline re-runs splitlines over growing buffer each 8000-char block
  4. Execution
    Quadratic CPU consumed on single readline call
  5. Impact
    Worker CPU core pinned, availability degraded (recoverable)

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 the application to process attacker-controlled corpus bytes through a line-oriented NLTK corpus reader - read_line_block, read_whitespace_block, read_wordpunct_block, or read_blankline_block - with an encoding configured, which is the common case and causes StreamBackedCorpusView._open to construct a SeekableUnicodeStreamReader. The malicious input must be one very long unterminated line (no newline), because that is what keeps the size=None readline loop running to end-of-file while the per-iteration splitlines rescan runs. LIMITING FACTORS: because the read block is capped at 8000 characters the constant factor is bounded, so a meaningful DoS needs a large crafted file; impact is recoverable CPU-availability degradation of the worker process, not a crash, and memory stays linear; and the lower-risk variant where a human manually loads the attacker's corpus requires user interaction. There is no line-length cap and no wall-clock backstop on this path (the nltk.redos timeout does not apply since no regex is involved).

Impact

Signals are consistent and point to a genuine but modest-severity issue, not a top-tier emergency. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L = 5.3) encodes availability-only, recoverable impact, which matches the advisory's own finding that the flaw pins one CPU core for O(N^2) time but causes no crash and keeps memory linear. The vuln.today decision label is 'this_month' (not act_now/emergency), aligning with the low-to-medium framing. No EPSS score and no KEV listing were provided, so there is no evidence of active exploitation - this is 'no public exploit identified' in the weaponized sense, but a working proof-of-concept timing harness IS published in the GHSA advisory, so exploitability is demonstrated, not theoretical. The main caveat is that AV:N assumes an automated ingestion path: the advisory explicitly distinguishes the worst credible case (an automated document-ingestion service feeding attacker uploads into a line-oriented corpus reader, no human step) from the more typical case where a user manually loads an attacker-supplied corpus, which adds user interaction and lowers real risk. Also note a data timing discrepancy - the source-code evidence snapshot (2026-09-28) records the fix as 'IN PROGRESS' on open PRs with develop still VULNERABLE, while the finalized NVD description and release tag confirm the fix shipped in 3.10.4; treat 3.10.4 as the authoritative fixed version. Net: a real, reproducible algorithmic-complexity DoS worth patching on a normal cycle, but not a drop-everything priority given availability-only impact, bounded constant factor, and the need for a large crafted file.

Exploit ScenarioDerived

An automated service ingests user-uploaded documents as NLTK corpora through a line-oriented corpus reader with an encoding set; an attacker uploads a file containing a single multi-megabyte line with no newline. SeekableUnicodeStreamReader.readline re-scans the whole growing buffer with splitlines on every 8000-char block, so a single readline call consumes CPU quadratic in the line length, degrading the worker's availability. A working proof-of-concept timing harness is published in the GHSA advisory (e.g. ~0.06s at 1M chars rising to ~4.7s at 8M chars, the ~4x-per-2x O(N^2) signature).

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% 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 consumption in NLTK's line reader (nltk/data.py SeekableUnicodeStreamReader.readline) before 3.10.4 allows remote attackers to degrade availability of any application that feeds attacker-supplied corpus files into a line-oriented corpus reader with an encoding configured. A single very long unterminated line forces the reader to re-scan its whole growing buffer on each loop iteration, so one readline call burns a CPU core for time quadratic in the line length. The result is recoverable CPU exhaustion in the processing worker rather than a crash, and because the read block is capped at 8000 characters a meaningful denial of service needs a large crafted file and is unauthenticated (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L, 5.3); a public proof-of-concept timing harness accompanies the vendor advisory, but no confirmed active exploitation or CISA KEV listing is reported, and the vendor-released fix is version 3.10.4.

RemediationAI

Vendor-released patch: 3.10.4, which fixes readline so it searches only the freshly decoded span for a line terminator instead of rescanning the whole buffer (commit 002bcf714ef8cb8baf94436f4be73e5516914412, PR https://github.com/nltk/nltk/pull/3895, release https://github.com/nltk/nltk/releases/tag/v3.10.4); upgrading is the complete fix and the advisory points to https://github.com/nltk/nltk/security/advisories/GHSA-q4c8-9gwf-255x. As interim mitigation, deployments that ingest untrusted corpora can bound the size of accepted input files or run corpus parsing under a CPU-time limit, though the vendor notes that neither removes the quadratic behavior in the reader itself; these only reduce exposure until the upgrade is applied. The nltk.redos timeout does not protect this path because no regular expression is involved, so it should not be relied on as a workaround.

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

NLTK's SeekableUnicodeStreamReader.readline in nltk/data.py assembles a line by reading a block, appending it to a growing chars buffer, and recomputing chars.splitlines(True) over the entire buffer on every iteration (nltk/data.py:1977-1978). The read size doubles only until it caps at 8000 characters (nltk/data.py:1997-1998), so for a single unterminated line of N characters the loop runs roughly N/8000 times while iteration k rescans about 8000*k characters, yielding O(N^2) total work. The one candidate guard, the early break 'if not new_chars or size is not None', is unreachable on this path because readline is defined with size=None (nltk/data.py:1942) and the shipped block readers read_line_block, read_whitespace_block, read_wordpunct_block and read_blankline_block in nltk/corpus/reader/util.py all call stream.readline() with no argument, so it only fires at end of file. Reaching the sink requires StreamBackedCorpusView._open to construct a SeekableUnicodeStreamReader, which happens when an encoding is set. There is no line-length cap and no wall-clock backstop, and the nltk.redos timeout does not mitigate this path because no regular expression is involved. The flaw maps to CWE-400 (Uncontrolled Resource Consumption) with the advisory also classifying it as CWE-407 (Inefficient Algorithmic Complexity), the same growing-buffer rescan class the project already treats as advisory-worthy in sibling corpus readers; the path/open security controls (_secure_open/pathsec) bound file access but not read-loop cost.

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 (GitHub_M) 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

Worst-case automated ingestion of an attacker-supplied file gives AV:N/PR:N/UI:N; crafting a long unterminated line is trivial (AC:L); impact is recoverable, bounded CPU degradation only, so C:N/I:N/A:L.

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_M).

CVSS VectorVendor: GitHub_M

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:16 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, SeekableUnicodeStreamReader.readline appends each new block to a growing character buffer and reruns splitlines over the entire buffer on every iteration. An attacker-controlled corpus file containing one very long unterminated line therefore causes quadratic CPU consumption in line-oriented corpus readers and can deny 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.4%
Top 65% exploitable
Prevalence
High
one of the most widely used Python NLP libraries in ML and research pipelines
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.4%
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
High
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 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-2026-78683 CRITICAL POC
9.4 Aug 25

Arbitrary code execution in NLTK (Natural Language Toolkit) through 3.9.4 allows attackers to run Python code when a vic

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-126297 HIGH POC
8.7 Nov 13

CPU exhaustion in NLTK's ConllCorpusReader.srl_instances() lets an attacker who supplies a crafted CoNLL SRL corpus pin

CVE-2026-126298 HIGH POC
8.7 Nov 13

CPU exhaustion in NLTK's Tree.chomsky_normal_form() right-factor binarization affects NLTK through 3.10.3 and lets remot

CVE-2026-126299 HIGH POC
8.7 Nov 13

Quadratic CPU exhaustion in NLTK's CCG lexicon parser (nltk.ccg.lexicon.fromstring, also re-exported as nltk.ccg.chart.f

CVE-2026-126303 HIGH POC
8.7 Nov 13

Denial of service in NLTK before 3.10.4 allows remote attackers to pin a CPU core and exhaust bounded worker pools by ca

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-78681 HIGH POC
8.7 Aug 25

XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of s

Vendor StatusVendor

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