CVE-2026-129225: NLTK: Uncontrolled recursion in DependencyGraph traversal causes denial of service via deep dependency chains
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. In 3.10.3 and earlier, DependencyGraph.tree and triples recurse once per dependency edge without a depth bound, and getcyclepath also lacks a visited-set termination guard. A deeply chained or cyclic attacker-controlled CoNLL or Malt-TAB dependency structure can raise RecursionError and abort a parse worker. This issue is fixed in version 3.10.4.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
nltk/nltkto a version that resolves this vulnerability.Fixed in 3.10.4
Event History
Frequently Asked Questions
Who is exposed to this denial-of-service issue?
Applications using NLTK 3.10.3 or earlier are exposed when they parse attacker-controlled dependency structures in CoNLL or Malt-TAB format. The issue can abort a parse worker.
What input is needed to trigger the issue?
An attacker can supply a deeply chained dependency structure, causing recursion once per dependency edge, or a cyclic structure that reaches cycle-handling logic without a visited-set termination guard. No privileges or user interaction are required according to the provided vector.
What is the remediation?
Upgrade NLTK to version 3.10.4, which fixes the issue.