CVE-2026-129233 in NLTK
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. From 3.10.0 until 3.10.4, StreamBackedCorpusView performs os.stat on a caller-supplied plain string path during construction before pathsec containment is enforced. The PathPointer branch used by in-tree corpus readers is validated, so exploitation requires application code to pass an attacker-influenced string directly to the public constructor. That string can identify an out-of-root path and disclose its existence, size, and modification time even though opening the file would be rejected. This issue is fixed in version 3.10.4.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 11/20/2026
The Natural Language Toolkit (NLTK) serves as a foundational suite of open-source Python modules for research and development in natural language processing. Within versions ranging from 3.10.0 to 3.10.4, the StreamBackedCorpusView class exhibits a critical information disclosure vulnerability rooted in its initialization sequence. This component is responsible for managing streams that read data from corpus files, which are essential datasets used by NLP algorithms. The flaw arises because the constructor performs an operating system stat call on a caller-supplied plain string path before any security containment mechanisms related to path validation are enforced.
This timing discrepancy creates a window where sensitive file metadata can be accessed without proper authorization checks. Specifically, when an attacker influences the input string passed directly to the public constructor of StreamBackedCorpusView, they can specify paths that lie outside the intended root directory or sandbox boundaries. Although subsequent operations such as actually opening and reading the file content would be rejected by the pathsec containment logic, the initial os.stat call succeeds in retrieving metadata about the target file. This includes sensitive details such as whether the file exists, its exact size on disk, and its last modification timestamp.
The operational impact of this vulnerability is primarily centered around information leakage rather than direct code execution or data exfiltration. By analyzing the existence, size, and modification times of files outside the allowed scope, an attacker can potentially map out the underlying filesystem structure of the host system running the NLTK application. This reconnaissance capability aids in further attacks by revealing file naming conventions, directory structures, and potential targets for more severe exploits such as path traversal or remote code execution if other vulnerabilities are present. The vulnerability is classified under CWE-209 which covers generation of error message containing information useful to attackers, although it specifically manifests here through metadata exposure rather than explicit error messages. In terms of the MITRE ATT&CK framework, this behavior aligns with T1083 File and Directory Discovery, where an adversary gathers knowledge about the system's file structure to facilitate subsequent stages of intrusion.
Exploitation requires a specific condition: the application code must pass an attacker-influenced string directly to the public constructor of StreamBackedCorpusView. The PathPointer branch used by in-tree corpus readers is properly validated, meaning that standard usage patterns within NLTK itself are not vulnerable. Therefore, this issue typically affects applications or scripts built on top of NLTK that do not sufficiently sanitize inputs before instantiating these specific view objects. This distinction highlights the importance of input validation at the application layer even when underlying libraries have partial protections in place.
To mitigate this vulnerability, organizations and developers should immediately upgrade to version 3.10.4 or later where the path security checks are enforced prior to any file system metadata operations. For systems that cannot be upgraded instantly, implementing strict input validation on all strings passed to NLTK corpus constructors is essential. Developers must ensure that only whitelisted paths within designated root directories are accepted and that absolute paths outside these boundaries are rejected before instantiation occurs. Additionally, applying the principle of least privilege by running NLP applications with restricted filesystem permissions can limit the impact if such an exploit were attempted in a legacy environment.