CVE-2026-63310 Overview
CVE-2026-63310 affects the Natural Language Toolkit (NLTK) Python library before version 3.9.3. The downloader module retrieves data packages over the network and extracts them without verifying file integrity. An attacker positioned to intercept traffic or manipulate DNS responses can substitute malicious archive contents. NLTK then extracts the tampered package on the target system, enabling arbitrary file placement and code execution under the identity of the Python process. The flaw is classified under CWE-494: Download of Code Without Integrity Check.
Critical Impact
Man-in-the-middle or DNS poisoning attackers can inject malicious NLTK package contents that are extracted without validation, leading to arbitrary code execution in Python environments that call the downloader.
Affected Products
- NLTK versions prior to 3.9.3
- Python applications and notebooks invoking nltk.download()
- Data science and NLP pipelines that fetch NLTK corpora or models at runtime
Discovery Timeline
- 2026-08-22 - CVE-2026-63310 published to the National Vulnerability Database
- 2026-08-24 - Last updated in NVD database
Technical Details for CVE-2026-63310
Vulnerability Analysis
NLTK's downloader retrieves ZIP archives containing corpora, tokenizers, and trained models from a package index. Before version 3.9.3, the client trusted the transport and did not compare a cryptographic hash or signature against a known-good value after download. The archive was then extracted directly into the user's nltk_data directory. An attacker who can modify traffic in flight or redirect the resolver to a hostile host can deliver arbitrary archive contents that NLTK writes to disk. Any subsequent code path that loads the tampered resource inherits attacker-controlled data or executable content.
Root Cause
The root cause is missing post-download integrity verification in the downloader module. Package metadata does not carry a verified digest, and the client does not enforce one after retrieval. This maps to CWE-494, download of code without integrity check.
Attack Vector
Exploitation requires a network-adjacent or upstream position such as a hostile Wi-Fi network, compromised proxy, ARP spoofing on a shared segment, or DNS cache poisoning against the resolver used by the victim. When a developer or automated job calls nltk.download('<package>'), the attacker returns a crafted archive. Extraction places attacker-chosen files under nltk_data, and later import or model-loading operations trigger the payload. No authentication or user interaction is required. See the GitHub Security Advisory GHSA-5wp5-5229-5g6q and the VulnCheck advisory on NLTK integrity checking for additional detail.
No verified public proof-of-concept code is available at this time. Refer to the vendor advisory for technical specifics.
Detection Methods for CVE-2026-63310
Indicators of Compromise
- Unexpected files or executables written under user or system nltk_data directories following a package download.
- HTTP or HTTPS requests to NLTK package hosts resolving to non-vendor IP addresses or unusual autonomous systems.
- Python processes spawning shells, network clients, or persistence utilities shortly after an nltk.download() call.
Detection Strategies
- Inventory Python environments and container images for nltk releases older than 3.9.3.
- Audit build logs, Jupyter notebooks, and CI pipelines for calls to nltk.download() executed on networks lacking TLS interception controls.
- Compare hashes of files in nltk_data against known-good values from a controlled mirror.
Monitoring Recommendations
- Log DNS resolutions and TLS destinations for hosts contacted by data science workloads and alert on deviations.
- Monitor filesystem writes to nltk_data paths and correlate with the initiating process and command line.
- Alert on child processes of the Python interpreter that perform outbound network activity immediately after archive extraction.
How to Mitigate CVE-2026-63310
Immediate Actions Required
- Upgrade NLTK to version 3.9.3 or later across all developer workstations, servers, containers, and CI runners.
- Rebuild container images and virtual environments that pinned an affected NLTK release.
- Review nltk_data directories on systems that ran nltk.download() on untrusted networks and replace contents from a trusted source.
Patch Information
The issue is fixed in NLTK 3.9.3. The maintainers document the fix in the GitHub Security Advisory GHSA-5wp5-5229-5g6q. Update using pip install --upgrade 'nltk>=3.9.3' and re-pin dependency manifests such as requirements.txt, pyproject.toml, or Pipfile.lock.
Workarounds
- Pre-stage required NLTK data on a trusted internal mirror and disable runtime downloads in production.
- Force HTTPS and enforce certificate pinning or an inspecting proxy that validates the NLTK package host.
- Restrict outbound network access from data science and inference workloads to an allowlist of validated endpoints.
# Upgrade NLTK and remove any tampered cached data
pip install --upgrade 'nltk>=3.9.3'
rm -rf ~/nltk_data
python -c "import nltk; nltk.download('punkt', download_dir='/opt/nltk_data')"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

