CVE-2026-12259

Improper Input Validation in nltk/nltk

Published Aug 3, 2026 CVSS 3.1 · 6.5 Medium EPSS < 1% KEV · Not listed
Description
In nltk version 3.9.4, the `nltk.downloader.Downloader._download_package()` function writes downloaded package bytes to disk and may extract them before enforcing SHA-256 or MD5 checksum validation. This allows an attacker to tamper with the package response body for `info.url` through a compromised mirror, malicious proxy, or other source-substitution condition, leading to the installation of attacker-controlled package bytes. The vulnerability can result in malicious corpus or model content being trusted by downstream users or applications.

Analysis

AI-generated

Technical impact

The flaw in nltk 3.9.4 allows the downloader to extract a package before validating its checksum, permitting an attacker who controls a mirror or proxy to replace the package contents. If the application accepts the extracted corpus or model, the attacker can inject arbitrary data or code into downstream processing, effectively delivering malicious content that is trusted by users. This weakness is captured by CWE‑354 and CWE‑494.

Affected Systems

Python applications that import and use nltk, specifically those running version 3.9.4, are impacted. Versions that have already incorporated checksum validation prior to extraction are not affected, and projects that do not use nltk are unaffected.

Risk and Exploitability

With a CVSS score of 5.3 the vulnerability is moderate, and its EPSS of <1% suggests a low but nonzero exploitation probability. It is not listed in the CISA KEV catalog. An attacker can exploit the flaw only when the application downloads packages from untrusted mirrors or when a mirror is compromised. Because no official patch or workaround is published, remediation relies on upgrading the library or implementing manual integrity checks; the risk also depends on the organization’s dependency‑management practices.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a newer nltk release that enforces checksum validation before extraction.
  • If an upgrade is not possible, calculate the SHA‑256/MD5 hash of the downloaded package and compare it to the expected value before extracting.
  • Restrict downloads to known, trusted mirrors, enforce HTTPS, and optionally apply certificate pinning to prevent source substitution.
  • If source verification cannot be assured, isolate nltk‑dependent code in a sandboxed environment to limit downstream impact.

Generated by OpenCVE AI on August 5, 2026 at 14:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-5wp5-5229-5g6q NLTK: Missing Post-Download Integrity Verification Allows Malicious Package Injection
History
Type Values Removed Values Added
First Time appeared Nltk nltk
CPEs cpe:2.3:a:nltk:nltk:3.9.4:*:*:*:*:*:*:*
Vendors & Products Nltk nltk
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N'}

cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N'}

Type Values Removed Values Added
Weaknesses CWE-354
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Nltk
Nltk nltk/nltk
Vendors & Products Nltk
Nltk nltk/nltk
Type Values Removed Values Added
Description In nltk version 3.9.4, the `nltk.downloader.Downloader._download_package()` function writes downloaded package bytes to disk and may extract them before enforcing SHA-256 or MD5 checksum validation. This allows an attacker to tamper with the package response body for `info.url` through a compromised mirror, malicious proxy, or other source-substitution condition, leading to the installation of attacker-controlled package bytes. The vulnerability can result in malicious corpus or model content being trusted by downstream users or applications.
Title Improper Input Validation in nltk/nltk
Weaknesses CWE-494
References
Metrics cvssV3_0

{'score': 5.3, 'vector': 'CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N'}

Weaknesses
  • CWE-354

    Improper Validation of Integrity Check Value

  • CWE-494

    Download of Code Without Integrity Check

Sources

Status
PUBLISHED
Assigner
@huntr_ai
Published
Updated
Aug 3, 2026, 2:59 PM
Reserved
Jun 15, 2026, 9:55 AM
Status
Analyzed
Published
Aug 3, 2026, 8:17 AM
Modified
Oct 23, 2026, 10:10 PM
Severity
Moderate
Public date
Aug 3, 2026, 7:09 AM