Skip to main content

NLTK CVE-2026-129227

| EUVDEUVD-2026-130435 MEDIUM
Uncontrolled Recursion (CWE-674)
2026-11-19 security-advisories@github.com GHSA-63wh-5r5m-wxr7
5.3
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit deeply nested JSON to app endpoint
  2. Exploit
    App decodes and calls Tree.fromlist on list
  3. Execution
    Unbounded per-level recursion exhausts call stack
  4. Impact
    Unhandled RecursionError terminates request worker

Vulnerability Assessment

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

Exploitation requires the application to pass an attacker-controlled nested list into nltk.tree.Tree.fromlist - the canonical pattern being Tree.fromlist(json.loads(untrusted_payload)) - or any later recursive traversal (height, pformat, equality) of an over-deep Tree. This is NOT reachable in default library usage; it depends on the application wiring untrusted input into the fromlist path. The attacker must supply nesting beyond the interpreter recursion limit (vendor evidence shows a reliable window from roughly depth 500 to ~1500 where json.loads still succeeds but fromlist raises). Limiting factors: impact is confined to aborting the current parse operation or request worker via a catchable RecursionError (no memory corruption, code execution, or data exposure), and confidentiality and integrity are unaffected.

Impact

This is a genuine but low-urgency availability issue, not a high-CVSS-but-overstated risk - the CVSS of 5.3 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L) correctly caps impact at availability only, with C:N/I:N confirming no data exposure or integrity loss. The vuln.today decision label is 'this_month' (not act_now/emergency), consistent with a denial-of-service that terminates a single parse operation or request worker via a catchable Python RecursionError rather than causing memory corruption or code execution (the GHSA explicitly states the recursion is pure Python). No CISA KEV listing and no EPSS score were provided in the input, so there is no signal of active or probable widespread exploitation; absence of these is not evidence of safety but does lower priority. A vendor-authored security probe and detailed bypass evidence exist (depth ~500-5000 reliably raises RecursionError within a window where json.loads still succeeds), demonstrating the flaw is real and reliably triggerable, but this is a maintainer test artifact rather than a weaponized exploit. The PR:N in the vector reflects no authentication intrinsic to the function, but realistic exploitation depends on the application exposing Tree.fromlist to untrusted input, which is application-specific - so raw CVSS network-unauthenticated framing overstates reach relative to the narrow real-world trigger condition.

Exploit ScenarioDerived

An application decodes an untrusted JSON payload and passes the resulting nested list into nltk.tree.Tree.fromlist (e.g. Tree.fromlist(json.loads(untrusted))). Because fromlist recurses once per nesting level with no depth bound, an adversarially deep list exhausts the Python call stack and raises an unhandled RecursionError, aborting the current operation or crashing the request worker. A vendor security probe exists demonstrating the crash at depth ~5000; it is a maintainer test artifact, not verified as a weaponized working exploit.

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

NLTK's Tree.fromlist, the nested-list constructor in nltk.tree, recurses once per nesting level with no depth bound, so an attacker-supplied deeply nested list crashes the current parse operation or request worker with a catchable RecursionError. Only applications that wire untrusted input into Tree.fromlist (typically Tree.fromlist(json.loads(untrusted))) or later walk an over-deep Tree via height, pformat, or equality are affected; versions up to and including 3.10.3 are vulnerable, and the vendor's sibling parser Tree.fromstring already enforced a MAX_TREE_DEPTH of 500 on the string path while the list path remained uncapped. The CVSS of 5.3 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L) correctly caps impact at availability only, no public exploit has been identified at time of analysis, and 3.10.4 bounds fromlist with the same MAX_TREE_DEPTH ValueError.

RemediationAI

Vendor-released patch: 3.10.4 - upgrade with pip install --upgrade nltk and confirm the installed version is at least 3.10.4, which contains commit ae4c5c900 (PR #3885) where Tree.fromlist takes a max_depth argument defaulting to MAX_TREE_DEPTH and raises a bounded ValueError once nesting exceeds it; the release tag is at https://github.com/nltk/nltk/releases/tag/v3.10.4 and the advisory at https://github.com/nltk/nltk/security/advisories/GHSA-63wh-5r5m-wxr7. Until the upgrade lands, applications that accept untrusted nested lists should enforce their own depth check on the decoded JSON before calling Tree.fromlist or reachability-block that path entirely, and should wrap fromlist invocations in try/except RecursionError at a request boundary to convert the crash into a rejected input (trade-off: catching RecursionError only works if the handler itself does not need deep stack, and it does not repair the pre-existing MAX_TREE_DEPTH inconsistency that the 3.10.4 change fixes). Switching untrusted input to the string path (Tree.fromstring) is a partial compensating control because that constructor already enforces MAX_TREE_DEPTH=500, but it requires the input to be a parseable bracketed string and changes parsing semantics. Disabling or gating any endpoint that forwards decoded JSON into Tree.fromlist is effective and low-risk if that functionality is not business-critical. Raising sys.setrecursionlimit is not a remediation: it merely moves the crash threshold and increases the risk of an interpreter-level stack fault, whereas the patched code fails fast with a ValueError. Note that on the pre-3.10.4 code the MAX_TREE_DEPTH constant has no effect on the fromlist path, so adjusting it is not a workaround.

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 Tree is a recursive tree data structure whose constructors build nested nodes, and Tree.fromlist walked a Python list, recursing per level with the only validation being that each element is a non-empty list. The sibling constructor Tree.fromstring had already been hardened with a module-level MAX_TREE_DEPTH = 500 (nltk/tree/tree.py) that rejects adversarially deep input with a bounded ValueError, but that guard was never applied to the list-construction path even though both build Tree objects identically. The root cause class is CWE-674 (Uncontrolled Recursion): the recursion is pure Python, so exhaustion yields a catchable RecursionError rather than memory corruption or code execution, and any later recursive traversal (height, pformat, equality) of an over-deep tree fails the same way. The realistic JSON delivery objection was tested and rejected - CPython's C JSON decoder tolerates much deeper nesting than pure-Python fromlist, giving a measured window from roughly depth 500 up to about 1500 at the default recursion limit where json.loads succeeds and fromlist is the component that raises, with the crash threshold coinciding with the project's own MAX_TREE_DEPTH value of 500. The applied tag list mentions information disclosure, but neither the upstream advisory nor the assessed vector supports data exposure - C:N/I:N confirms the impact is availability-only.

Know when Python 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) 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

Availability-only DoS (A:L) from a catchable RecursionError; AC:L and PR:N/UI:N because once an app exposes fromlist to input, sending a deep list is trivial and needs no auth.

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

CVSS VectorVendor: github

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 - 18:18 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, Tree.fromlist recursively converts nested Python list input into Tree objects without enforcing a maximum tree depth. An attacker-controlled list nested beyond the interpreter recursion limit can raise RecursionError and terminate the current 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.4%
Top 63% exploitable
Prevalence
High
NLTK is a very widely used Python NLP library across research and ML
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.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 Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy