Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload crafted corpus file with one unterminated line
-
DeliveryService feeds file to line-oriented NLTK corpus reader (encoding set)
-
Exploitreadline re-runs splitlines over growing buffer each 8000-char block
-
ExecutionQuadratic CPU consumed on single readline call
-
ImpactWorker 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). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
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
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.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- 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
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.
Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p
Arbitrary code execution in NLTK (Natural Language Toolkit) through 3.9.4 allows attackers to run Python code when a vic
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
CPU exhaustion in NLTK's ConllCorpusReader.srl_instances() lets an attacker who supplies a crafted CoNLL SRL corpus pin
CPU exhaustion in NLTK's Tree.chomsky_normal_form() right-factor binarization affects NLTK through 3.10.3 and lets remot
Quadratic CPU exhaustion in NLTK's CCG lexicon parser (nltk.ccg.lexicon.fromstring, also re-exported as nltk.ccg.chart.f
Denial of service in NLTK before 3.10.4 allows remote attackers to pin a CPU core and exhaust bounded worker pools by ca
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
XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of s
EUVD-2026-130491
GHSA-q4c8-9gwf-255x
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB