PyPI: nltk

CVE-2025-14009

Safety vulnerability ID: SFTY-20260218-01424

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.

Created at: Mar 6, 2026Updated at: Mar 6, 2026

Overview

NLTK has a Zip Slip Vulnerability

Advisory

NLTK has a Zip Slip Vulnerability

Affected Package

Affecting nltk package, versions
<= 3.9.2

Also affects

---

How to Fix

Upgrade
nltk
to
3.9.3
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more