Staging Environment: Content and features may be unstable or change without notice.
Search for packages
Package details: pkg:pypi/nltk@3.2
purl pkg:pypi/nltk@3.2
Next non-vulnerable version 3.9.4
Latest non-vulnerable version 3.9.4
Risk 4.5
Vulnerabilities affecting this package (12)
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.
3.9.4
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.
3.9
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
3.4.5
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.
3.9.3
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.
3.9.3
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.
3.9.3
Affected by 3 other vulnerabilities.
VCID-h8dd-9um6-b3f7
Aliases:
CVE-2021-3828
GHSA-2ww3-fxvq-293j
PYSEC-2021-356
denial of service
3.6.4
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.
3.9.4
Affected by 0 other vulnerabilities.
VCID-ty4s-3zke-nka1
Aliases:
CVE-2021-3842
GHSA-rqjh-jp2r-59cj
PYSEC-2022-5
NLTK Vulnerable to REDoS
3.6.6
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.
3.9.3
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)
3.6.5
Affected by 10 other vulnerabilities.
3.6.6
Affected by 8 other vulnerabilities.
Vulnerabilities fixed by this package (0)
Vulnerability Summary Aliases
This package is not known to fix vulnerabilities.

Date Actor Action Vulnerability Source VulnerableCode Version
2026-06-13T08:35:04.910109+00:00 GHSA Importer Affected by VCID-h8dd-9um6-b3f7 https://github.com/advisories/GHSA-2ww3-fxvq-293j 38.6.0
2026-06-12T21:33:24.905030+00:00 GitLab Importer Affected by VCID-stbm-19e9-8khz https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2026-33231.yml 38.6.0
2026-06-12T21:33:16.516808+00:00 GitLab Importer Affected by VCID-c8kx-p4f2-1fck https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2026-33236.yml 38.6.0
2026-06-12T21:32:21.042561+00:00 GitLab Importer Affected by VCID-aydp-euhu-3bgh https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/GHSA-rf74-v2fm-23pw.yml 38.6.0
2026-06-12T21:31:42.190535+00:00 GitLab Importer Affected by VCID-8gac-u2vb-qkcq https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2026-33230.yml 38.6.0
2026-06-12T21:19:40.660164+00:00 GitLab Importer Affected by VCID-yjax-vd1r-zua8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2026-0846.yml 38.6.0
2026-06-12T21:17:01.222395+00:00 GitLab Importer Affected by VCID-ebeb-dyr8-9fb1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2026-0847.yml 38.6.0
2026-06-12T21:00:01.885594+00:00 GitLab Importer Affected by VCID-gg3u-72s3-tkfh https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2025-14009.yml 38.6.0
2026-06-12T19:34:05.471950+00:00 GitLab Importer Affected by VCID-9z4z-ntd4-j3g1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2024-39705.yml 38.6.0
2026-06-12T17:55:12.622202+00:00 GitLab Importer Affected by VCID-zgsu-4k3d-93h2 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2021-43854.yml 38.6.0
2026-06-12T17:55:07.469874+00:00 GitLab Importer Affected by VCID-ty4s-3zke-nka1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2021-3842.yml 38.6.0
2026-06-12T17:48:42.383433+00:00 GitLab Importer Affected by VCID-h8dd-9um6-b3f7 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2021-3828.yml 38.6.0
2026-06-12T17:13:51.428367+00:00 GitLab Importer Affected by VCID-bb2e-qckd-uqh1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/nltk/CVE-2019-14751.yml 38.6.0