Uncontrolled Recursion Affecting nltk package, versions [,3.10.3)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

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 IDSNYK-PYTHON-NLTK-19639038
  • published7 Sept 2026
  • disclosed2 Sept 2026
  • creditUnknown

Introduced: 2 Sep 2026

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

How to fix?

Upgrade nltk to version 3.10.3 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 the RecursiveDescentParser in nltk/parse/recursivedescent.py. An attacker can pin a CPU core indefinitely or exhaust the Python recursion stack by supplying a tiny left-recursive or highly ambiguous grammar and triggering top-down parsing on even a short input. The parser enumerates parse trees recursively with no default bound on the search, so crafted grammars cause unbounded work and hang the process. This can deny service to applications that parse untrusted grammars or user-controlled input with RecursiveDescentParser or SteppingRecursiveDescentParser.

CVSS Base Scores

version 4.0
version 3.1