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

Introduced: 19 Nov 2026

NewCVE-2026-129224  (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 CCG lexicon parser. matchBrackets (nltk/ccg/lexicon.py) calls itself once per nested ( character, and augParseCategory recurses once per bracketed sub-category. Neither function tracks recursion depth, and the public entry point fromstring applies no length or nesting cap before passing input to the parser. An attacker who supplies a deeply nested category string causes an unhandled RecursionError that aborts the affected parse operation or request worker.

CVSS Base Scores

version 4.0
version 3.1