Skip to main content

NLTK CVE-2026-129226

| EUVDEUVD-2026-130432 MEDIUM
Uncontrolled Recursion (CWE-674)
2026-11-19 GitHub_M GHSA-w3pv-xfw4-ghr7
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
    Supply deeply nested type string
  2. Exploit
    Reach Type.fromstring or signature typecheck
  3. Execution
    read_type recurses past recursion limit
  4. Impact
    Unhandled 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.

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

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

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 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

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

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.

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:30 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, 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
† 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 63% exploitable
Prevalence
High
NLTK is a very widely deployed Python NLP library across research and ML stacks
Threat Intel
1
1 source
Data Quality
3 sources
Confidence: Low
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
None
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

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