Skip to main content

NLTK CVE-2026-129224

| EUVDEUVD-2026-130498 MEDIUM
Uncontrolled Recursion (CWE-674)
2026-11-19 GitHub_M GHSA-3h95-x772-4765
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
    Identify endpoint parsing untrusted CCG lexicon
  2. Delivery
    Submit lexicon string with ~2000 nested parentheses
  3. Exploit
    Unbounded recursion in matchBrackets/augParseCategory
  4. Execution
    Exceed interpreter recursion limit
  5. Impact
    Unhandled 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

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

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

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

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

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.

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 - 20:04 EUVD
CVE Published
Nov 19, 2026 - 18:04 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 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
† 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.5%
Top 54% exploitable
Prevalence
High
NLTK is a very widely deployed Python NLP library
Threat Intel
1
1 source
Data Quality
4 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.5%
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

27
Low Medium High Critical
KEV: 0
EPSS: +1
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