Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply deeply nested type string
-
ExploitReach Type.fromstring or signature typecheck
-
Executionread_type recurses past recursion limit
-
ImpactUnhandled RecursionError aborts worker
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
|
| Exploitation Conditions | Exploitation requires the host application to pass attacker-controlled input into the semantic-logic type parser: specifically a call to nltk.sem.logic.Type.fromstring(s) with an untrusted type string, or type-checking an expression against an attacker-influenced signature via Expression.typecheck(signature) or Expression.fromstring(expr, type_check=True, signature=...), where each signature value reaches read_type. The triggering input is a deeply nested complex type string (e.g. '<'*n + 'e,e' + '>'*n). Limiting factors: this is NOT a default exposure - most NLTK usage never feeds untrusted data to the semantic-logic type/signature parameters, so exposure is narrower than a general-purpose parser; impact is confined to availability (abort of a single operation or request worker) with no confidentiality or integrity effect; and the resulting RecursionError is catchable Python, not memory corruption. Affected versions are <= 3.10.3; fixed in 3.10.4. |
| Impact | This is a moderate, availability-only issue - the signals are internally consistent and point to low urgency despite the network-reachable CVSS vector. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L, base 5.3) reflects that triggering is trivial once input reaches the parser, with no privileges or user interaction, but impact is confined to availability (C:N/I:N/A:L). The GHSA advisory explicitly confirms confidentiality and integrity are unaffected and that the recursion is pure Python, yielding a catchable RecursionError rather than memory corruption or code execution - so this is a worker/request abort, not RCE. No EPSS score and no CISA KEV entry are provided in the input, and there is no indication of active exploitation; the vuln.today decision label is 'this_month' (routine patch cadence), not act_now/emergency. A public PoC reference exists in the form of the repository security probe (nltk/test/unit/security_probes/ghsa_w3pv_xfw4_ghr7.py) demonstrating the depth-driven RecursionError, but it is not verified as a weaponized working exploit. The one data conflict worth stating: the input Tags label this 'Information Disclosure', which contradicts the advisory and the CVSS vector (C:N/I:N, A:L) - this is purely a denial-of-service/uncontrolled-recursion flaw, not information disclosure. Net: a real but low-priority DoS, reachable only where an application feeds untrusted data into the semantic-logic type parser. |
| Exploit ScenarioDerived | An application that parses untrusted type strings - e.g. calling nltk.sem.logic.Type.fromstring(s) or type-checking an expression against an attacker-influenced signature via Expression.typecheck(signature) or Expression.fromstring(expr, type_check=True, signature=...) - receives a deeply nested type string such as '<'*n + 'e,e' + '>'*n. The read_type parser recurses on both halves of each complex type without applying MAX_PARSE_DEPTH, so once nesting exceeds the interpreter recursion limit an unhandled RecursionError propagates and aborts the current request worker. A repository security probe publicly demonstrates the depth-driven failure, but no verified weaponized exploit is reported. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 19, 2026
Uncontrolled recursion in NLTK's semantic-logic type parser lets a deeply nested type string such as '<'*n + 'e,e' + '>'*n drive read_type past the interpreter's recursion limit and abort the calling operation with an unhandled RecursionError, a CWE-674 availability-only denial of service rated CVSS 5.3. Only deployments that route untrusted data into nltk.sem.logic.Type.fromstring, Expression.typecheck(signature), or Expression.fromstring(..., type_check=True, signature=...) are exposed; most NLTK usage never feeds untrusted input to those type/signature parameters, so exposure is narrower than a general-purpose parser. Affected versions are <= 3.10.3 and the flaw is fixed in 3.10.4; no public exploit or confirmed active exploitation was identified at time of analysis, and the impact is limited to crashing a single operation or request worker with no confidentiality or integrity effect.
RemediationAI
Upgrade to NLTK 3.10.4, the vendor-released patch version, which bounds read_type recursion via LogicParser.MAX_PARSE_DEPTH and also adds MAX_PARSE_DEPTH and MAX_XML_DEPTH limits to the CCG lexicon parser and to nested-XML traversal in the BNC and SemCor corpus readers; the fix originates in PR #3885 (https://github.com/nltk/nltk/pull/3885) with commits 2f4f0d47e2c452c89cabc2a5f761332d51066ea8 and a8036c5e7f820ac09c96b969d6e7f19bfa6e6aeb, and the advisory is at https://github.com/nltk/nltk/security/advisories/GHSA-w3pv-xfw4-ghr7. Until the upgrade is deployed, the effective compensating control is to prevent untrusted input from reaching the type-string and signature parameters - do not pass externally supplied strings to nltk.sem.logic.Type.fromstring, and do not type-check expressions against attacker-influenced signatures via Expression.typecheck or Expression.fromstring(..., type_check=True, signature=...), since exposure only exists where the application itself forwards such input to those entry points; rejecting type strings whose nesting depth exceeds a small application-defined threshold achieves the same effect at the cost of having to define and maintain that limit. Wrapping the affected calls in a handler for RecursionError limits the blast radius to a failed request rather than a terminated worker, but it does not prevent the stack exhaustion itself and still consumes the worker for the duration of the deep parse. Raising Python's interpreter recursion limit or thread stack size is not a durable workaround, because the attack depth is attacker-chosen and any increase simply moves the threshold; the same reasoning applies to the configurable MAX_PARSE_DEPTH value introduced by the fix, which vendors should not raise for untrusted inputs.
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 semantic-logic module parses typed lambda expressions, and its read_type routine (nltk/sem/logic.py:866) recurses on both halves of every '<a,b>' complex type at nltk/sem/logic.py:882-884 with no depth or length bound - only an isinstance assertion and a parenthesis-balance assertion guard each level. The class-level LogicParser.MAX_PARSE_DEPTH guard (nltk/sem/logic.py:107,294) protects the expression parser but is never applied on the read_type path, which is reached directly by the public Type.fromstring classmethod (nltk/sem/logic.py:736) and by signature-string type checking (nltk/sem/logic.py:1080). Because the recursion is pure Python, an adversarially nested type string exhausts stack frames and raises a catchable RecursionError rather than causing memory corruption or code execution; the reporter's shipped-code probe parsed depth 5 cleanly and raised at depth 5000, confirming the failure is depth-driven rather than an assertion failure. The upstream fix (PR #3885, commits 2f4f0d47e and a8036c5e7) bounds read_type by LogicParser.MAX_PARSE_DEPTH and applies comparable MAX_PARSE_DEPTH / MAX_XML_DEPTH limits to the CCG lexicon parser (nltk/ccg/lexicon.py matchBrackets, nextCategory, augParseCategory, fromstring) and to nested-XML traversal helpers in the BNC and SemCor corpus readers, converting runaway recursion into a bounded ValueError.
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
Trivial-to-craft nested string triggers recursion with no privileges or interaction (AV:N/AC:L/PR:N/UI:N), but impact is only a single worker abort, so A:L and C:N/I:N.
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 semantic-logic read_type parser recursively processes both halves of nested complex type strings without applying LogicParser.MAX_PARSE_DEPTH. An attacker-controlled type string or signature with excessive nesting can raise RecursionError through Type.fromstring or type-checking entry points and abort the current 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-130432
GHSA-w3pv-xfw4-ghr7
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB