home / blog

2026-11-22 · medium

CVE-2026-129227: NLTK Recursion Vulnerability Causes DoS

NLTK <=3.10.3 vulnerable to infinite recursion causing process termination during parsing.

CVE-2026-129227: NLTK Recursion Vulnerability Causes DoS

CVE-2026-129227 is a vulnerability in NLTK (Natural Language Toolkit) versions up to 3.10.3. The issue lies in the Tree.fromlist function that recursively converts nested Python lists into Tree objects without enforcing a maximum tree depth. An attacker can exploit this vulnerability by providing input with nesting beyond the interpreter's recursion limit, causing RecursionError that terminates the parsing operation or worker request.

The vulnerability is classified as medium severity (CVSS 5.3). The issue has been officially recognized and patched on November 19, 2026, with the release of version 3.10.4. GitHub signals confirm the vulnerability's existence, showing how a list nested to depth 3000 causes RecursionError in vulnerable versions, while the fixed version limits depth to 500 elements.

For defense, administrators should immediately update NLTK to version 3.10.4. For applications using older versions that cannot be immediately updated, implement custom validation controls to limit the depth of nested lists in user-provided inputs. Monitor logs to detect potential exploitation attempts through anomalous input.

At a glance

What
Recursion vulnerability in Tree.fromlist causing parse operation termination
Severity
medium (CVSS 5.3)
Affected versions
NLTK < 3.10.4
Fix
Update to version 3.10.4
Status
Patch available
Action
Apply patch or implement custom depth limits

Sources: NVD, CVE-2026-129227

← All articles