Skip to main content

NLTK CVE-2026-129228

| EUVDEUVD-2026-130496 MEDIUM
Uncontrolled Recursion (CWE-674)
2026-11-19 GitHub_M GHSA-f2h2-f4fc-p978
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
    Craft Toolbox settings file nested thousands deep
  2. Delivery
    Submit to app that parses untrusted input
  3. Exploit
    Application invokes recursive helper (e.g. to_settings_string)
  4. Execution
    Helper recurses past interpreter recursion limit
  5. Impact
    Unhandled RecursionError aborts worker (DoS)

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
Exploitation Conditions

Two concrete prerequisites must both hold: (1) the application parses an attacker-supplied/untrusted Toolbox settings file via ToolboxSettings.open_string/open plus parse, and (2) it subsequently passes the resulting tree to one of the five public helpers - to_settings_string, remove_blanks, add_default_fields, sort_fields, or add_blank_lines (the module's own parse-then-serialise round trip triggers this). The attacker must supply input nested beyond the interpreter recursion limit via many \+marker/\-marker pairs (clean at 5 levels, failure demonstrated at ~5000 levels); the config-taking helpers fail even with empty configuration dictionaries. Limiting factors that reduce real-world risk: the vulnerable Toolbox-settings code path is a niche feature rarely exposed to untrusted input, so despite the network vector the realistic attack surface is narrow; the result is a catchable RecursionError (availability only) affected versions <= 3.10.3, fixed in 3.10.4.

Impact

Signals point to a genuine but moderate-priority availability issue, not a top-tier emergency. The CVSS 3.1 base vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L, 5.3) shows a network-reachable, unauthenticated, no-interaction flaw whose only impact is a low availability hit - confidentiality and integrity are explicitly unaffected per the GHSA advisory. CWE-674 (uncontrolled recursion) produces a catchable Python RecursionError, so the worst case is a crashed operation or request worker, not code execution or memory corruption. No CISA KEV listing is present (not actively exploited per available data), and no EPSS score was provided, so exploitation probability cannot be quantified from the input. A repository security probe (ghsa_f2h2_f4fc_p978.py) reproduces the condition, but there is no indication of weaponized public exploit code. The vuln.today decision label is 'this_month', consistent with routine patching rather than act_now/emergency. Important caveat: the AV:N network vector overstates real-world reach - exploitation is only possible in applications that actually parse untrusted Toolbox settings files AND then call one of the five recursive helpers, a narrow and uncommon code path within an otherwise very popular library. Net: a real issue to patch on a normal cadence, not a high-urgency widespread threat.

Exploit ScenarioDerived

An attacker submits a Toolbox settings file containing thousands of nested \+marker/\-marker pairs (demonstrated at ~5000 levels deep) to an application that parses untrusted input via ToolboxSettings and then serialises or transforms it through a public helper such as to_settings_string. The iterative parse succeeds, but the recursive helper exhausts the interpreter's call-stack limit and raises an unhandled RecursionError, aborting the request worker (denial of service). A public PoC reference exists as the project's own security probe; it is not verified as weaponized exploit code.

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

Denial of service in NLTK (Natural Language Toolkit) through 3.10.3 lets unauthenticated remote attackers abort an operation or request worker by supplying a Toolbox settings file nested deeper than the Python interpreter recursion limit. The producer, ToolboxSettings.parse, builds the settings tree iteratively and completes cleanly, but the public helpers to_settings_string, remove_blanks, add_default_fields, sort_fields and add_blank_lines each recurse once per element level with no depth bound, so a downstream parse-then-serialise round trip raises an unhandled RecursionError; the config-taking helpers fail even with empty configuration dictionaries. Impact is availability only (CVSS 5.3, AV:N/AC:L/PR:N/UI:N/C:N/I:N/A:L) and the realistic attack surface is narrow because the Toolbox settings code path is rarely fed untrusted input; no CISA KEV entry exists, and a public reproducer exists in the upstream security probe test (documented at roughly 5000 nesting levels) rather than as standalone remote exploit code. Fixed in 3.10.4.

RemediationAI

Upgrade to NLTK 3.10.4 (pip install -U 'nltk>=3.10.4') and confirm the installed version, since the advisory's fix-status note records that the correcting merge commit e521ecafc on PR #3885 initially landed on develop with no release tag containing it at that time, while the release tag v3.10.4 and package metadata list 3.10.4 as fixed - verify the deployed distribution rather than assuming. Because the fix enforces MAX_TOOLBOX_DEPTH=500 at parse time and now raises ValueError, callers must handle ValueError from ToolboxSettings.parse/open_string and from the helper functions where they previously assumed parsing always succeeded. If upgrading is not immediately possible, do not pass untrusted or attacker-supplied Toolbox settings files through the parse-then-serialise round trip: restrict upload/ingest paths that accept Toolbox settings to trusted sources, or pre-validate nesting depth (reject inputs with more than a few hundred \+marker / \-marker levels) before invoking any of the five helpers - trade-off: depth pre-checks must be applied consistently at every call site, and an unpatched library still fails on any path that is missed. Running the parsing and serialisation work in an isolated worker that can be restarted limits the blast radius of a RecursionError to a single job, at the cost of added infrastructure and partial loss of in-flight state; catching RecursionError around the helper calls is only a partial control, since the failure occurs after deep recursion has consumed stack and the operation must still be abandoned. Applicable fixes and version guidance are documented at https://github.com/nltk/nltk/security/advisories/GHSA-f2h2-f4fc-p978, https://github.com/nltk/nltk/pull/3885 and https://github.com/nltk/nltk/releases/tag/v3.10.4.

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 is a Python NLP library; the affected component is nltk/toolbox.py, which parses Toolbox settings files where nesting is expressed through attacker-supplied \+marker / \-marker pairs. CWE-674 (uncontrolled recursion) is the root cause: the design deliberately made parsing iterative, so a 4999-deep tree is constructed without error, while the traversal side (_to_settings_string at toolbox.py:418, remove_blanks at :432, add_default_fields at :451, _sort_fields at :484, add_blank_lines at :502 and :516) uses pure-Python recursion with no depth counter or explicit stack. Because the recursion is pure Python, the failure is a catchable RecursionError - no memory corruption, code execution, confidentiality or integrity impact - but when it propagates uncaught out of the public API it terminates the calling operation or request worker. Verification in the upstream advisory shows a 5-level input traversing every helper cleanly and a 5000-level input driving all five helpers to RecursionError, confirming the fault is isolated to the recursive helpers and not the parser. The upstream fix (PR #3885, commit 0b6975377) caps traversal at MAX_TOOLBOX_DEPTH=500 and raises ValueError instead of letting the interpreter's stack limit be reached; the same PR additionally bounded recursion in the CCG lexicon parser (MAX_PARSE_DEPTH) and in the BNC and SemCor XML corpus readers (MAX_XML_DEPTH), which are separate uncontrolled-recursion surfaces in the same module family. Note that the advisory tags mention 'Information Disclosure', which does not match the actual assessed impact of availability-only denial of service.

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

Attacker-supplied Toolbox file is processed network-reachably with no auth or interaction (AV:N/AC:L/PR:N/UI:N); only availability is affected (A:L) via a catchable RecursionError, so 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 - 20:04 EUVD
CVE Published
Nov 19, 2026 - 18:03 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, ToolboxSettings.parse builds a deeply nested attacker-controlled settings tree iteratively, but the later public helpers to_settings_string, remove_blanks, add_default_fields, sort_fields, and add_blank_lines recursively traverse that tree without a depth bound. Invoking any of those helpers on input nested beyond the interpreter recursion limit can raise RecursionError and abort the 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 59% exploitable
Prevalence
High
NLTK is among the most widely installed Python NLP libraries, though the Toolbox path is niche
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

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