Search for packages
| purl | pkg:pypi/nltk@3.2 |
| Vulnerability | Summary | Fixed by |
|---|---|---|
|
VCID-8gac-u2vb-qkcq
Aliases: CVE-2026-33230 GHSA-gfwx-w7gr-fvh7 |
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. In versions 3.9.3 and prior, `nltk.app.wordnet_app` contains a reflected cross-site scripting issue in the `lookup_...` route. A crafted `lookup_<payload>` URL can inject arbitrary HTML/JavaScript into the response page because attacker-controlled `word` data is reflected into HTML without escaping. This impacts users running the local WordNet Browser server and can lead to script execution in the browser origin of that application. Commit 1c3f799607eeb088cab2491dcf806ae83c29ad8f fixes the issue. |
Affected by 0 other vulnerabilities. |
|
VCID-9z4z-ntd4-j3g1
Aliases: CVE-2024-39705 GHSA-cgvx-9447-vcch PYSEC-2024-167 |
NLTK through 3.8.1 allows remote code execution if untrusted packages have pickled Python code, and the integrated data package download functionality is used. This affects, for example, averaged_perceptron_tagger and punkt. |
Affected by 7 other vulnerabilities. |
|
VCID-aydp-euhu-3bgh
Aliases: GHSA-rf74-v2fm-23pw |
Natural Language Toolkit (NLTK) has unbounded recursion in JSONTaggedDecoder.decode_obj() may cause DoS ### Summary `JSONTaggedDecoder.decode_obj()` in `nltk/jsontags.py` calls itself recursively without any depth limit. A deeply nested JSON structure exceeding `sys.getrecursionlimit()` (default: 1000) will raise an unhandled `RecursionError`, crashing the Python process. ### Affected code File: `nltk/jsontags.py`, lines 47–52 ```python @classmethod def decode_obj(cls, obj): if isinstance(obj, dict): obj = {key: cls.decode_obj(val) for (key, val) in obj.items()} elif isinstance(obj, list): obj = list(cls.decode_obj(val) for val in obj) ``` ### Proof of Concept ```python import sys, json from nltk.jsontags import JSONTaggedDecoder depth = sys.getrecursionlimit() + 50 # e.g. 1050 payload = '{"x":' * depth + "null" + "}" * depth # Raises RecursionError, crashing the process json.loads(payload, cls=JSONTaggedDecoder) ``` ### Impact Any code path that passes externally-supplied JSON to `JSONTaggedDecoder` is vulnerable to denial of service. The severity depends on whether such a path exists in the calling code (e.g. `nltk/data.py`). ### Suggested Fix Add a depth parameter with a hard limit: ```python @classmethod def decode_obj(cls, obj, _depth=0): if _depth > 100: raise ValueError("JSON nesting too deep") if isinstance(obj, dict): obj = {key: cls.decode_obj(val, _depth + 1) for (key, val) in obj.items()} elif isinstance(obj, list): obj = list(cls.decode_obj(val, _depth + 1) for val in obj) ``` | There are no reported fixed by versions. |
|
VCID-bb2e-qckd-uqh1
Aliases: CVE-2019-14751 GHSA-mr7p-25v2-35wr PYSEC-2019-106 |
NLTK Vulnerable To Path Traversal |
Affected by 11 other vulnerabilities. |
|
VCID-c8kx-p4f2-1fck
Aliases: CVE-2026-33236 GHSA-469j-vmhf-r6v7 |
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. In versions 3.9.3 and prior, the NLTK downloader does not validate the `subdir` and `id` attributes when processing remote XML index files. Attackers can control a remote XML index server to provide malicious values containing path traversal sequences (such as `../`), which can lead to arbitrary directory creation, arbitrary file creation, and arbitrary file overwrite. Commit 89fe2ec2c6bae6e2e7a46dad65cc34231976ed8a patches the issue. |
Affected by 3 other vulnerabilities. |
|
VCID-ebeb-dyr8-9fb1
Aliases: CVE-2026-0847 GHSA-68j8-pq59-fqgm PYSEC-2026-98 |
A vulnerability in NLTK versions up to and including 3.9.2 allows arbitrary file read via path traversal in multiple CorpusReader classes, including WordListCorpusReader, TaggedCorpusReader, and BracketParseCorpusReader. These classes fail to properly sanitize or validate file paths, enabling attackers to traverse directories and access sensitive files on the server. This issue is particularly critical in scenarios where user-controlled file inputs are processed, such as in machine learning APIs, chatbots, or NLP pipelines. Exploitation of this vulnerability can lead to unauthorized access to sensitive files, including system files, SSH private keys, and API tokens, and may potentially escalate to remote code execution when combined with other vulnerabilities. |
Affected by 3 other vulnerabilities. |
|
VCID-gg3u-72s3-tkfh
Aliases: CVE-2025-14009 GHSA-7p94-766c-hgjp PYSEC-2026-96 |
A critical vulnerability exists in the NLTK downloader component of nltk/nltk, affecting all versions. The _unzip_iter function in nltk/downloader.py uses zipfile.extractall() without performing path validation or security checks. This allows attackers to craft malicious zip packages that, when downloaded and extracted by NLTK, can execute arbitrary code. The vulnerability arises because NLTK assumes all downloaded packages are trusted and extracts them without validation. If a malicious package contains Python files, such as __init__.py, these files are executed automatically upon import, leading to remote code execution. This issue can result in full system compromise, including file system access, network access, and potential persistence mechanisms. |
Affected by 3 other vulnerabilities. |
|
VCID-h8dd-9um6-b3f7
Aliases: CVE-2021-3828 GHSA-2ww3-fxvq-293j PYSEC-2021-356 |
denial of service |
Affected by 10 other vulnerabilities. |
|
VCID-stbm-19e9-8khz
Aliases: CVE-2026-33231 GHSA-jm6w-m3j8-898g |
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. In versions 3.9.3 and prior, `nltk.app.wordnet_app` allows unauthenticated remote shutdown of the local WordNet Browser HTTP server when it is started in its default mode. A simple `GET /SHUTDOWN%20THE%20SERVER` request causes the process to terminate immediately via `os._exit(0)`, resulting in a denial of service. Commit bbaae83db86a0f49e00f5b0db44a7254c268de9b patches the issue. |
Affected by 0 other vulnerabilities. |
|
VCID-ty4s-3zke-nka1
Aliases: CVE-2021-3842 GHSA-rqjh-jp2r-59cj PYSEC-2022-5 |
NLTK Vulnerable to REDoS |
Affected by 8 other vulnerabilities. |
|
VCID-yjax-vd1r-zua8
Aliases: CVE-2026-0846 GHSA-h8wq-7xc4-p3qx PYSEC-2026-97 |
A vulnerability in the `filestring()` function of the `nltk.util` module in nltk version 3.9.2 allows arbitrary file read due to improper validation of input paths. The function directly opens files specified by user input without sanitization, enabling attackers to access sensitive system files by providing absolute paths or traversal paths. This vulnerability can be exploited locally or remotely, particularly in scenarios where the function is used in web APIs or other interfaces that accept user-supplied input. |
Affected by 3 other vulnerabilities. |
|
VCID-zgsu-4k3d-93h2
Aliases: CVE-2021-43854 GHSA-f8m6-h2c7-8h9x PYSEC-2021-859 |
Inefficient Regular Expression Complexity in nltk (word_tokenize, sent_tokenize) |
Affected by 10 other vulnerabilities. Affected by 8 other vulnerabilities. |
| Vulnerability | Summary | Aliases |
|---|---|---|
| This package is not known to fix vulnerabilities. | ||