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-22733175
  • published22 Nov 2026
  • disclosed19 Nov 2026
  • creditDaniel Coles

Introduced: 19 Nov 2026

NewCVE-2026-129228  (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 the Toolbox settings-tree helpers in nltk/toolbox.py. The functions _to_settings_string (line 418), remove_blanks (line 432), add_default_fields (line 451), _sort_fields (line 484), and add_blank_lines (lines 502, 516) each recurse once per element level with no depth bound. Because ToolboxSettings.parse builds the element tree iteratively, an attacker can supply a Toolbox settings file with arbitrarily many \+marker / \-marker nesting pairs, producing a tree deep enough to exhaust the Python call stack. When any of the public helper functions is subsequently called on that tree, an unhandled RecursionError propagates out of the public API, terminating the affected operation or request worker.

CVSS Base Scores

version 4.0
version 3.1