home / blog

2026-11-22 · medium

CVE-2026-129226: Recursion Vulnerability in NLTK

NLTK vulnerable to infinite recursion in logic parser, exploitable via malicious input.

CVE-2026-129226: Recursion Vulnerability in NLTK

CVE-2026-129226 affects NLTK (Natural Language Toolkit), a suite of open source Python modules for Natural Language Processing. The issue lies in the read_type parser for semantic-logic types, which recursively processes both halves of nested complex type strings without applying LogicParser.MAX_PARSE_DEPTH, allowing malicious input to cause infinite recursion.

Severity is classified as medium (CVSS 5.3) and mainly represents a denial of service risk, as the vulnerability causes a RecursionError that aborts the current worker without remote code execution capability. The vulnerability has been confirmed by both NVD and technical reports on GitHub, where crashes at 3000 recursion levels were observed in the vulnerable version compared to a limit of 200 in the patched version.

To defend against this threat, it is essential to update NLTK to version 3.10.4 or later. In the absence of immediate patches, mitigation measures such as input validation to limit the depth of nested type structures or careful monitoring of NLTK processes for CPU usage anomalies caused by infinite recursion attempts can be implemented.

At a glance

What
Vulnerability in NLTK's semantic-logic parser allowing an attacker to cause a RecursionError and abort the current worker.
Severity
Medium (CVSS 5.3)
Affected versions
NLTK versions prior to 3.10.4
Fix
Update to version 3.10.4 or later
Status
Confirmed, patch available
Action
Apply the update or implement temporary mitigations

Sources: NVD, CVE-2026-129226

← All articles