{"id":"CVE-2026-63310","aliases":["CVE-2026-63310","GHSA-5wp5-5229-5g6q","GHSA-gf32-cmjh-8m9v","PYSEC-2026-3729","PYSEC-2026-4318"],"related":["CVE-2026-12259"],"kind":"vulnerability","state":"rejected","title":"CVE-2026-63310 (rejected)","summary":"This CVE ID has been rejected or withdrawn by its CVE Numbering Authority.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"This CVE ID has been rejected or withdrawn by its CVE Numbering Authority.","source":"cvelist"},{"lang":"en","text":"NLTK's package downloader in nltk/downloader.py does not verify file integrity after download and before extraction.\n\nThe download flow at lines 789-825:\n1. File is downloaded to a temp path via HTTP\n2. os.replace(tmp_filepath, filepath) moves it to the final location (line 799)\n3. Extraction begins via _unzip_iter() (line 825)\n\nBetween steps 2 and 3, there is no SHA-256 verification. The checksum logic exists in _pkg_status() (lines 982-1015) but it is only used BEFORE download as a status check (\"is this package already installed and up-to-date?\"). It is never called after download to verify the file that was actually received.\n\nAttack vectors:\n1. MITM during HTTP download (NLTK downloads from http:// by default on some mirrors)\n2. Race condition on shared filesystems (attacker replaces file between os.replace and _unzip_iter)\n3. DNS poisoning redirecting to attacker-controlled server\n\nPoC:\n```python\nimport nltk\nimport unittest.mock\nimport zipfile\nimport io\nimport os\n\n# Create a malicious zip that will be \"downloaded\"\nmalicious_zip = io.BytesIO()\nwith zipfile.ZipFile(malicious_zip, 'w') as zf:\n    zf.writestr('punkt_tab/tokenizers/punkt_tab/english.pickle', \n                b'MALICIOUS PAYLOAD - attacker controlled content')\n\n# Patch urllib to return our malicious zip\nwith unittest.mock.patch('urllib.request.urlopen') as mock_urlopen:\n    mock_response = unittest.mock.MagicMock()\n    mock_response.read.return_value = malicious_zip.getvalue()\n    mock_response.headers = {'Content-Length': str(len(malicious_zip.getvalue()))}\n    mock_urlopen.return_value = mock_response\n    \n    # Download proceeds, no integrity check catches the swap\n    # nltk.download('punkt_tab')  # Would install attacker payload\n```\n\nThis is distinct from CVE-2024-39705 (pickle deserialization via download) and CVE-2025-14009 (zip-slip path traversal). Those address what happens AFTER extraction. This finding addresses the gap BEFORE extraction where integrity is never verified.\n\nSuggested fix: After os.replace() and before _unzip_iter(), compute SHA-256 of the final file and compare against the expected checksum from the package index. Reject and delete the file if the hash does not match.","format":"markdown","source":"ghsa"},{"lang":"en","text":"## Duplicate Advisory\n\nThis advisory has been withdrawn because it is a duplicate of GHSA-5wp5-5229-5g6q. This link is maintained to preserve external references.\n\n## Original Description\nNLTK before 3.9.3 fails to verify file integrity after downloading packages and before extraction in the downloader module. Attackers can perform man-in-the-middle attacks or DNS poisoning to inject malicious package contents that are extracted without validation.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Rejected reason: This CVE ID has been rejected or withdrawn by its CVE Numbering Authority.","source":"nvd"},{"lang":"en","text":"NLTK before 3.9.3 fails to verify file integrity after downloading packages and before extraction in the downloader module. Attackers can perform man-in-the-middle attacks or DNS poisoning to inject malicious package contents that are extracted without validation.","format":"markdown","source":"pysec"},{"lang":"en","text":"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.","format":"markdown","source":"pysec"}],"published":"2026-08-03T08:17:17.880Z","modified":"2026-10-16T15:10:00.103Z","severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:H","score":7.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-494"],"affected":[{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.9.3"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"3.9.2"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.9.3"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"3.9.4"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"pysec"}],"references":[{"url":"https://github.com/nltk/nltk/security/advisories/GHSA-5wp5-5229-5g6q","tags":["evidence","web"],"sources":["ghsa","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-12259","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/pull/3449","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/commit/0e26734a61094b628d93e26dc18dd7302567ac46","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/releases/tag/3.9.3","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3729.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://huntr.com/bounties/659ccf6d-12d4-4d4a-84c0-078633c35a5d","tags":["report","web"],"sources":["ghsa","pysec"]},{"url":"https://www.vulncheck.com/advisories/nltk-before-missing-post-download-integrity-verification","tags":["advisory","web"],"sources":["ghsa","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63310","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-5wp5-5229-5g6q","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"VulnCheck","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-63310","url":"https://www.cve.org/CVERecord?id=CVE-2026-63310","licence":"CVE Terms of Use","modified":"2026-09-14T23:10:03.270Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5wp5-5229-5g6q","url":"https://github.com/advisories/GHSA-5wp5-5229-5g6q","licence":"CC-BY-4.0","modified":"2026-10-16T10:56:05.808Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gf32-cmjh-8m9v","url":"https://github.com/advisories/GHSA-gf32-cmjh-8m9v","licence":"CC-BY-4.0","modified":"2026-10-16T10:56:05.808Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-63310","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63310","licence":"Public domain","modified":"2026-10-16T15:10:00.103Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3729","url":"https://osv.dev/vulnerability/PYSEC-2026-3729","licence":"CC-BY-4.0","modified":"2026-10-16T10:56:05.808Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4318","url":"https://osv.dev/vulnerability/PYSEC-2026-4318","licence":"CC-BY-4.0","modified":"2026-10-16T10:56:05.808Z"}],"updatedAt":"2026-11-25T22:59:34.875Z"}