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-22733163
  • published22 Nov 2026
  • disclosed19 Nov 2026
  • creditDaniel Coles, manus-use

Introduced: 19 Nov 2026

NewCVE-2026-129227  (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 Tree.fromlist in nltk/tree/tree.py, which converts a nested list into a Tree by recursing once per nesting level with no depth bound. Its only validation is that the argument is a non-empty list, so an attacker who supplies a deeply nested list causes an unhandled RecursionError that terminates the affected operation or request worker. The sibling constructor Tree.fromstring was already hardened with a MAX_TREE_DEPTH cap that raises a bounded ValueError, but that guard was not applied to fromlist. Any subsequent recursive traversal of an over-deep tree (via height, pformat, or equality checks) fails the same way.

CVSS Base Scores

version 4.0
version 3.1