CVE-2025-14009: NLTK Zip Slip Vulnerability Leading to Remote Code Execution
Summary
CVE-2025-14009: NLTK has a Zip Slip Vulnerability. Affects nltk versions < 3.9.2. No fix is published. How to fix ↓
Also tracked for
The same CVE-2025-14009 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
NLTK (Natural Language Toolkit) is a widely-used Python library for natural language processing (NLP). It provides easy-to-use interfaces to over 50 corpora and lexical resources, along with a suite of text processing libraries for classification, tokenization, stemming, tagging, parsing, and more. The NLTK downloader component facilitates the downloading of these resources. However, it is vulnerable to a critical security flaw that allows attackers to exploit the package extraction process.
Vulnerability Detail
A critical vulnerability exists in the NLTK downloader component of nltk/nltk, affecting all versions up to 3.9.2. 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.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, avoid using the NLTK downloader to extract zip files from untrusted sources. Instead, manually download and verify the integrity of the packages before extracting them.
Conclusion
The NLTK Zip Slip vulnerability (CVE-2025-14009) poses a significant risk to users by allowing remote code execution through unvalidated zip file extraction. It is crucial to update to the latest version of NLTK to mitigate this risk and ensure the security of your applications.
See every vulnerability recorded for nltk →
FAQ
The CVSS score of this vulnerability is 10.0, indicating a critical severity level.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit the Vulert playground at Vulert Scanner to check if your application is affected without requiring any signup.
Exploitation of this vulnerability can lead to remote code execution, allowing attackers to gain full control over the affected system, including access to files and network resources.
Yes, NLTK version 3.9.3 and later have patched this vulnerability and are safe to use.
If immediate updating is not possible, refrain from using the NLTK downloader for untrusted zip files and consider manually verifying and downloading necessary resources.
References
Related vulnerabilities
Recent vulnerabilities recorded for nltk.