Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify endpoint parsing untrusted CCG lexicon
-
DeliverySubmit lexicon string with ~2000 nested parentheses
-
ExploitUnbounded recursion in matchBrackets/augParseCategory
-
ExecutionExceed interpreter recursion limit
-
ImpactUnhandled RecursionError aborts request worker
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
|
| Exploitation Conditions | Exploitation requires the target application to pass attacker-controlled text into NLTK's CCG lexicon parser - specifically nltk.ccg.lexicon.fromstring (also re-exported as nltk.ccg.chart.fromstring) - with no length or nesting cap applied by the application. The attacker needs no authentication or user interaction (AV:N/AC:L/PR:N/UI:N), but the payload must reach that parser. Strong limiting factors: CCG lexicon parsing is a niche NLTK feature rarely exposed to untrusted input; the raised RecursionError is a catchable pure-Python exception (no memory corruption or code execution), so impact is confined to the in-flight parse/request, and an application that wraps the parse in an exception handler fully contains the failure. |
| Impact | This is a genuine but low-urgency denial-of-service issue, and the signals are internally consistent rather than conflicting. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L, base 5.3 Medium) correctly reflects a limited availability-only impact: the GHSA confirms C:N/I:N and an availability hit bounded to the affected parse operation or request worker. The priority Decision label is 'this_month', not act_now/emergency. KEV status is not present in the input (no CISA KEV entry), and no EPSS score was supplied, so exploitation-probability cannot be quantified from this data. A reproducible public PoC reference exists (the GHSA ships a concrete payload and a committed security-probe test), but the input does not mark it 'Publicly available (confirmed)' as working exploit code, so treat it as a PoC reference rather than confirmed weaponized exploit code. The dominant limiting factor is reachability: the flaw only matters to applications that feed untrusted input into the CCG lexicon parser (nltk.ccg.lexicon.fromstring), an uncommon code path, which caps real-world risk well below what AV:N/PR:N alone might suggest. One minor input discrepancy: the CVE and a referenced release tag (v3.10.4) state the fix ships in 3.10.4, while the GitHub fix-status note dated 2026-09-28 says the fix was merged on develop with no release yet - verify the 3.10.4 release actually contains merge commit e521ecafc / fix commit 30e93eb7b before relying on it. |
| Exploit ScenarioDerived | An application exposes NLTK's CCG lexicon parsing to untrusted input and calls nltk.ccg.lexicon.fromstring on a user-supplied string. An attacker submits a deeply nested category such as ':- S\nw => ' + '('*2000 + 'S' + ')'*2000, and the unbounded recursion in matchBrackets/augParseCategory exceeds the interpreter recursion limit (~1000 frames at the default), raising an unhandled RecursionError that aborts the request worker. A reproducible PoC payload and a security-probe test are published in the GHSA advisory; because AV:N/AC:L/PR:N, no authentication or special timing is needed, but a reachable parse path for untrusted lexicon text is. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 19, 2026
Deeply nested parenthesized category strings fed to NLTK's CCG lexicon parser drive unbounded Python recursion, raising an uncaught RecursionError that aborts the in-flight parse or request worker. NLTK versions up to and including 3.10.3 are affected through nltk.ccg.lexicon.fromstring (also re-exported as nltk.ccg.chart.fromstring); no authentication or user interaction is required, but the attacker-controlled text must actually reach that parser. Impact is availability-only and limited: the exception is catchable pure Python, there is no memory-corruption or code-execution primitive, and confidentiality and integrity are untouched; a repository security probe reproduces the failure, but no public working exploit code is confirmed, and the issue is not in CISA KEV.
RemediationAI
Vendor-released patch: NLTK 3.10.4, which introduces a configurable MAX_PARSE_DEPTH of 500 so matchBrackets and augParseCategory raise a bounded ValueError instead of recursing past the interpreter limit; upgrade with pip install 'nltk>=3.10.4'. The underlying code change landed via PR #3885 (https://github.com/nltk/nltk/pull/3885) in commit 30e93eb7b (https://github.com/nltk/nltk/commit/30e93eb7b69021293e019042fe0cedb99c95b054), and the advisory is at https://github.com/nltk/nltk/security/advisories/GHSA-3h95-x772-4765. If upgrading is not immediately possible, the practical compensating control is to stop untrusted text from reaching nltk.ccg.lexicon.fromstring or nltk.ccg.chart.fromstring - reject or truncate lexicon strings containing excessive consecutive opening parentheses and cap overall input length before parsing, at the cost of refusing some legitimately deep but valid categories; alternatively, wrap the parse call in an explicit handler for RecursionError (and ValueError after patching) so a raised exception fails only that parse instead of terminating the request worker, accepting that the operation still fails. On patched builds, operators who genuinely need deeper nesting beyond 500 levels can raise nltk.ccg.lexicon.MAX_PARSE_DEPTH, but doing so re-exposes the parser to deeper stack consumption and should be limited to trusted input. Note that the same upstream change adds MAX_XML_DEPTH bounds in the BNC and SemCor corpus XML readers, so those paths also surface deep-nesting input as ValueError after the update.
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 flaw is uncontrolled recursion (CWE-674) in NLTK's combinatory categorial grammar (CCG) lexicon module. In nltk/ccg/lexicon.py, matchBrackets (around line 154) calls itself once per nested opening parenthesis, and augParseCategory (around lines 228 and 242) recurses once per bracketed sub-category; the public entry point fromstring applies no length or nesting cap before routing the category text into this machinery through LEX_RE/RHS_RE matching. Each nesting level consumes CPython call-stack frames, so when depth approaches the interpreter recursion limit (default 1000) a RecursionError propagates out of the public API; a dependency-free replay of matchBrackets parsed balanced input at depth 5 and 500 cleanly but raised an unhandled RecursionError at depth 2000 and 5000, confirming the failure is depth-driven rather than a generic parse error. NLTK already had comparable guards elsewhere (FeatStructReader, Tree.fromstring's MAX_TREE_DEPTH, LogicParser's MAX_PARSE_DEPTH), which is the pattern the fix follows. The CPE cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:* covers the package broadly, with the advisory narrowing vulnerable builds to 3.10.3 and earlier.
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
Remote unauthenticated input into a reachable parser (AV:N/AC:L/PR:N/UI:N); catchable RecursionError aborts only the affected worker, so C:N/I:N and 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, the CCG lexicon parser's matchBrackets and augParseCategory functions recursively process nested parenthesized categories without a depth bound. An attacker-controlled lexicon string with excessive nesting can raise RecursionError through nltk.ccg.lexicon.fromstring and terminate the parse operation or request worker. 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
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-130498
GHSA-3h95-x772-4765
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB