CVE-2025-14009: Nltk NLTK Has A Zip Slip Vulnerability

CRITICAL
Advisory Identifier: GHSA-7p94-766c-hgjp
CVSS 10.0
CWE-94
Published
Advisory Summary

CVE-2025-14009 is a CRITICAL (CVSS 10.0) nltk has a zip slip vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Nltk libraries in the PyPI ecosystem. The issue involves nltk has a zip slip vulnerability. Remediation is available by upgrading affected packages to version 3.9.3.

CVE-2025-14009 at a Glance

CVE Identifier CVE-2025-14009
GHSA Identifier GHSA-7p94-766c-hgjp
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Nltk
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-14009

To remediate this vulnerability, upgrade all affected Nltk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nltk fixed: 3.9.3
pip install nltk>=3.9.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show nltk

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-14009, inspect your installed packages using pip:

pip show nltk

Analyze the terminal output to locate any version of Nltk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.9.3), your application is affected.

Note: The pip show nltk command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Nltk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2025-14009 Affected Nltk Versions

1 component(s)
Fixed Versions:
3.9.3
Product / Package Ecosystem Affected Versions Fixed Version
nltk
PyPI
< 3.9.3
3.9.3

References

Frequently Asked Questions

What is CVE-2025-14009?
CVE-2025-14009 is a security vulnerability in Nltk involving NLTK has a Zip Slip Vulnerability under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Nltk versions are affected?
Affected versions include releases prior to 3.9.3 across affected packages: nltk.
What version fixes CVE-2025-14009?
Upgrading to 3.9.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nltk affected?
Yes, nltk is affected in releases prior to 3.9.3. Upgrade your dependency to 3.9.3 or later.
What is the CVSS score of CVE-2025-14009?
CVE-2025-14009 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2025-14009?
CVE-2025-14009 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check PyPI dependencies for CVE-2025-14009?
Run the dependency tree command: 'pip show nltk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7p94-766c-hgjp",
  "modified" : "2026-06-06T14:46:18Z",
  "published" : "2026-02-18T18:30:40Z",
  "aliases" : [ "CVE-2025-14009" ],
  "summary" : "NLTK has a Zip Slip Vulnerability",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nltk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.9.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.9.2"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-14009"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nltk/nltk/pull/3468"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nltk/nltk/commit/1056b323af6462455571302e766b67cf300aea18"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nltk/nltk"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nltk/nltk/blob/4154eb85e832f266660a09286c7e37e308292284/ChangeLog#L1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-96.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/49ecbc02-054e-4470-b2e0-b267936cc4e4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-19T20:27:43Z",
    "nvd_published_at" : "2026-02-18T18:24:19Z"
  }
}