CVE-2026-126296 in NLTKinfo

Summary

by MITRE • 11/13/2026

NLTK before 3.10.4 contains a path traversal vulnerability in save_maxent_params() and load_maxent_params() that bypasses the pathsec filesystem restriction mechanism. Attackers who control the tab_dir argument can read or overwrite model parameter files outside permitted data roots, because the functions call Python's built-in open() directly.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/13/2026

The Natural Language Toolkit (NLTK) is a widely used library for symbolic and statistical natural language processing in Python, offering easy-to-use interfaces to over fifty corpora and lexical resources such as WordNet along with classes implementing classifiers, tokenizers, parsers, and semantic reasoning tools. Within this ecosystem, the functions save_maxent_params() and load_maxent_params() are critical components responsible for persisting and retrieving parameters associated with maximum entropy models, which are frequently employed in text classification tasks. A significant security flaw exists in these specific functions prior to version 3.10.4, characterized as a path traversal vulnerability that undermines the intended filesystem access controls implemented by the library's internal pathsec mechanism. This architectural weakness allows an attacker who has control over the tab_dir argument to bypass restrictions designed to limit file operations to permitted data roots, thereby enabling unauthorized reading or overwriting of model parameter files located outside these designated directories.

The technical root cause of this vulnerability lies in how the affected functions handle input validation and file system interactions. The pathsec module is intended to act as a security layer that restricts file access to specific whitelisted directories, preventing arbitrary file reads or writes that could lead to information disclosure or code execution via configuration poisoning. However, save_maxent_params() and load_maxent_params() circumvent this protection by invoking Python's built-in open() function directly without applying the necessary path normalization or validation checks enforced elsewhere in the library. By passing a tab_dir argument that contains relative paths with directory traversal sequences such as ../, an attacker can construct file paths that escape the restricted root directory. Because the underlying open() call does not validate whether the resolved absolute path remains within the allowed boundaries, the operating system permits access to any file location for which the executing user has appropriate permissions.

The operational impact of this vulnerability is severe and multifaceted depending on the context in which NLTK is deployed. In scenarios where model parameters are loaded from untrusted sources or when application logic allows users to influence the tab_dir parameter, an attacker can perform arbitrary file reads. This capability facilitates information disclosure by allowing the extraction of sensitive data stored in configuration files, environment variables exposed through text-based config formats, or other critical system files on the host machine. Furthermore, if write permissions are available for target directories outside the permitted root, attackers can overwrite existing model parameter files with malicious content. Since these parameters often influence the behavior of subsequent inference processes, injecting crafted data could potentially lead to logic manipulation, denial of service through malformed inputs causing crashes during parsing, or in complex deployment architectures involving serialized object loading, it may serve as a precursor to remote code execution if combined with other vulnerabilities such as deserialization flaws.

To mitigate this vulnerability, organizations must immediately upgrade the NLTK library to version 3.10.4 or later, where the developers have addressed the direct invocation of open() by ensuring that path traversal sequences are properly sanitized and validated against the configured data roots before any file system operations occur. For environments unable to patch immediately due to dependency constraints, defensive coding practices should be implemented as a temporary workaround. This includes validating all user-supplied paths using strict allowlists for permitted directories rather than relying solely on blacklist-based filtering of traversal characters. Additionally, applications should enforce the principle of least privilege by running processes with minimal file system permissions and utilizing operating-level sandboxing or containerization to limit the blast radius in case a path traversal is successfully exploited. Monitoring logs for unusual access patterns to model parameter files can also aid in early detection of exploitation attempts targeting this weakness.

This vulnerability aligns with Common Weakness Enumeration (CWE) category CWE-22, which defines Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The attack vector corresponds to ATT&CK technique T1083, File and Directory Discovery, when used for information gathering, or potentially T1553 if the overwritten parameters are leveraged to establish persistence or subvert trust mechanisms within the application logic. By understanding this flaw through these standardized frameworks, security teams can better contextualize the risk profile and prioritize remediation efforts alongside other similar input validation deficiencies in their software supply chain.

Responsible

VulnCheck

Reservation

11/10/2026

Disclosure

11/13/2026

Moderation

accepted

CPE

ready

EPSS

0.00272

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!