CVE-2026-129227 in NLTKinfo

Summary

by MITRE • 11/20/2026

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, Tree.fromlist recursively converts nested Python list input into Tree objects without enforcing a maximum tree depth. An attacker-controlled list nested beyond the interpreter recursion limit can raise RecursionError and terminate the current parse operation or request worker. This issue is fixed in version 3.10.4.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/20/2026

The Natural Language Toolkit, commonly known as NLTK, serves as a foundational suite of open-source Python modules for research and development in natural language processing. Within this ecosystem, the Tree class provides functionality to represent hierarchical structures such as parse trees or syntax trees derived from linguistic data analysis. A critical security flaw was identified in versions prior to 3.10.4 regarding the implementation of the Tree.fromlist method. This static factory method is designed to convert nested Python list inputs into corresponding Tree objects, effectively mapping the structural hierarchy of the input lists onto the tree nodes and leaves required for further linguistic processing tasks.

The technical vulnerability stems from a lack of depth validation during the recursive conversion process. When Tree.fromlist processes an input list, it recursively calls itself to handle sub-lists that represent child nodes in the resulting tree structure. However, the implementation does not enforce any maximum recursion limit or check against Python's interpreter recursion threshold. Consequently, if an attacker can control the input data and provide a deeply nested list structure, the recursive function will continue calling itself until it exceeds the system-defined recursion limit. This exhaustion of stack space triggers a RecursionError exception within the Python runtime environment.

From an operational perspective, this flaw presents a significant risk for denial-of-service conditions in applications that rely on NLTK for processing untrusted or user-supplied text data. In server-side environments where parse operations are handled by dedicated worker processes, such as those using web frameworks with background task queues, the sudden termination of a worker due to a RecursionError can lead to service degradation. If the application does not have robust error handling mechanisms in place to catch and recover from this specific exception, it may result in dropped requests, increased latency for other users, or complete unavailability of the affected service endpoints until the process is restarted by an orchestrator or supervisor.

This vulnerability aligns with CWE-787: Out-of-bounds Write in terms of stack exhaustion principles, although more specifically it relates to resource consumption through improper validation of input depth. In the context of the MITRE ATT&CK framework, this behavior can be categorized under T1499: Endpoint Denial of Service or potentially T1053: Scheduled Task/Job if exploited in a way that causes repeated crashes affecting system stability. The core issue is rooted in CWE-20: Improper Input Validation, as the software fails to validate the structural complexity and depth of the input data before processing it through recursive logic.

To mitigate this vulnerability, organizations must ensure they upgrade NLTK to version 3.10.4 or later, where the Tree.fromlist method has been patched to enforce a maximum tree depth limit. For applications that cannot immediately update dependencies due to compatibility constraints, defensive programming practices should be implemented. This includes wrapping calls to Tree.fromlist in try-except blocks specifically targeting RecursionError exceptions and implementing pre-validation logic to check the nesting level of incoming lists before passing them to NLTK functions. Additionally, configuring application-level timeouts or resource limits can help contain the impact if such an attack vector is attempted against legacy systems that remain unpatched for extended periods.

Responsible

GitHub M

Reservation

11/13/2026

Disclosure

11/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00419

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!