Recursion Depth Vulnerability in NLTK Natural Language Toolkit
CVE-2026-129227
5.3MEDIUM
What is CVE-2026-129227?
The Natural Language Toolkit (NLTK), widely used for Natural Language Processing in Python, has a vulnerability in the Tree.fromlist function that allows recursive conversion of nested Python lists into Tree objects without a maximum depth limit. This can be exploited by attackers who provide deeply nested lists, potentially exceeding the Python interpreter's recursion limit. Such an attack could lead to a RecursionError, causing the current parsing operation or worker request to terminate unexpectedly. This issue was addressed in the NLTK version 3.10.4, highlighting the importance for users to update to the latest version to ensure secure operations.
Affected Version(s)
nltk < 3.10.4
