Uncontrolled Recursion Affecting nltk package, versions [,3.10.4)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.52% (38th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Uncontrolled Recursion vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-NLTK-22733178
  • published22 Nov 2026
  • disclosed19 Nov 2026
  • creditDaniel Coles

Introduced: 19 Nov 2026

NewCVE-2026-129225  (opens in a new tab)
CWE-674  (opens in a new tab)

How to fix?

Upgrade nltk to version 3.10.4 or higher.

Overview

nltk is a Natural Language Toolkit (NLTK) is a Python package for natural language processing.

Affected versions of this package are vulnerable to Uncontrolled Recursion via uncontrolled recursion in DependencyGraph._tree (nltk/parse/dependencygraph.py). The traversal helpers _tree, tree, and triples recurse over dependency links with no depth bound and no visited set, while the neighbouring contains_cycle method was already rewritten as an iterative depth-first search. An attacker who supplies a CoNLL/Malt-TAB dependency structure forming a linear chain of roughly 500 or more tokens causes an unhandled RecursionError when the application calls tree() or triples(), terminating the affected operation or request worker. get_cycle_path additionally lacks a visited set and will not terminate on a genuine cycle.

CVSS Base Scores

version 4.0
version 3.1