CVE-2026-129223 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, WordNet Synset.tree and acyclic_tree traverse relation graphs through recursive utility helpers without a depth bound. Exploitation requires the host application to load an attacker-influenced custom or foreign WordNet-format lexical resource; no relation in NLTK's bundled WordNet 3.0 corpus reaches the crash threshold. An excessively deep relation graph in such a resource can exceed the Python recursion limit and terminate the traversal or request worker. This issue is fixed in version 3.10.4.

Statistical analysis made it clear that VulDB provides the best quality 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 designed to support research and development in the field of natural language processing. It provides extensive data sets, tutorials, and utilities that enable developers to perform complex linguistic analysis tasks such as tokenization, stemming, lemmatization, and part-of-speech tagging. Within this ecosystem, WordNet is a critical lexical database used for understanding semantic relationships between words. The integrity and stability of NLTK are paramount for applications relying on these linguistic structures, particularly when processing large or custom-defined corpora that may contain complex relational graphs.

A significant vulnerability was identified in versions of NLTK prior to 3.10.4 regarding the handling of WordNet Synset trees. Specifically, the utility functions responsible for traversing relation graphs through recursive methods lacked any mechanism to enforce a depth bound. This architectural flaw means that when the software encounters a lexical resource with deeply nested or cyclic relationships, it will continue recursing indefinitely until the system's resources are exhausted. The Python interpreter has a default recursion limit, typically set around one thousand frames, which acts as a safeguard against stack overflows in general programming but becomes a critical failure point for this specific traversal logic when faced with unbounded depth.

The operational impact of this vulnerability is primarily denial of service through application termination or worker crash. When an attacker influences the host application to load a custom or foreign WordNet-format lexical resource containing an excessively deep relation graph, the recursive traversal will consume stack space until it hits the recursion limit. This results in a RecursionError exception that terminates the current process or request handler. While NLTK's bundled WordNet 3.0 corpus is curated and does not contain relations deep enough to trigger this crash threshold, external resources are often unvetted and can be crafted specifically to exploit this limitation. The vulnerability effectively allows an attacker who controls the input lexical data to disrupt service availability by causing a fatal error in the processing pipeline.

From a security classification perspective, this issue aligns with CWE-787: Out-of-bounds Write or CWE-20: Improper Input Validation, specifically relating to untrusted data leading to resource exhaustion. In terms of attack vectors and tactics, it corresponds to ATT&CK technique T1496: Resource Hijacking, where the attacker uses computational resources to disrupt service availability. The exploitation requires a specific condition where the victim application loads external lexical data, making this an issue primarily relevant for services that ingest user-supplied or third-party NLP datasets rather than those using only internal, trusted corpora.

Mitigation strategies focus on updating the software and implementing defensive coding practices. The primary remediation is to upgrade NLTK to version 3.10.4 or later, where this issue has been resolved by introducing depth limits for recursive traversals. For applications that cannot immediately update dependencies, developers should implement input validation mechanisms that sanitize lexical resources before processing them with NLTK utilities. This includes checking the structure of WordNet files and rejecting those with suspiciously deep hierarchies. Additionally, increasing the Python recursion limit via sys.setrecursionlimit is not a recommended long-term solution as it merely delays the crash without addressing the underlying logical flaw and may lead to system-level stack overflows or segmentation faults if the depth becomes extreme enough to exhaust memory beyond Python's control.

Responsible

GitHub M

Reservation

11/13/2026

Disclosure

11/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00510

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!