CVE-2026-129228: NLTK: Uncontrolled recursion in Toolbox settings helpers causes denial of service via deeply nested input
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. Prior to 3.10.4, ToolboxSettings.parse builds a deeply nested attacker-controlled settings tree iteratively, but the later public helpers tosettingsstring, removeblanks, adddefaultfields, sortfields, and addblanklines recursively traverse that tree without a depth bound. Invoking any of those helpers on input nested beyond the interpreter recursion limit can raise RecursionError and abort the operation or request worker. This issue is fixed in version 3.10.4.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.10.4
Event History
Frequently Asked Questions
Which deployments are exposed to this denial-of-service condition?
Deployments using NLTK versions before 3.10.4 are affected when they parse attacker-controlled Toolbox settings input and then invoke one of the affected public helper methods. The helpers are to_settings_string, remove_blanks, add_default_fields, sort_fields, and add_blank_lines.
What does an attacker need to do to trigger the issue?
An attacker needs to supply Toolbox settings input nested beyond the Python interpreter's recursion limit. When the application later calls an affected helper on the resulting settings tree, it can raise RecursionError and abort the operation or request worker.
Is there a fixed version?
Yes. The issue is fixed in NLTK version 3.10.4.
How can teams tell whether they may already be affected?
Check whether the application uses an NLTK release earlier than 3.10.4 and accepts untrusted input for ToolboxSettings.parse. Exposure also requires that the application calls one of the affected recursive helper methods on the parsed settings tree.