{"vuln_id":"CVE-2026-128135","aliases":["GHSA-wr3g-j6qj-xpgh"],"description":"NLTK: ZIP package extraction follows in-root hardlinks and overwrites files outside the NLTK data root","published_at":"2026-11-19T18:18:05.837000Z","modified_at":"2026-11-22T21:00:05.725287Z","first_seen_at":"2026-11-21T19:15:19.334740Z","severity":"high","severity_source":"nvd","cvss_score":7.1,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","cwe":["CWE-59","CWE-73"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00225,"epss_percentile":0.1325,"nvd_status":"Awaiting Analysis","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-128135"},"matched_alias":null,"items":[{"id":10690,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-wr3g-j6qj-xpgh: NLTK: ZIP package extraction follows in-root hardlinks and overwrites files outside the NLTK data root","summary":"NLTK: ZIP package extraction follows in-root hardlinks and overwrites files outside the NLTK data root\n\n## Summary\n\nNLTK ships a security wrapper, `nltk.pathsec.ZipFile`, that is meant to confine archive extraction to trusted data roots and to block link-based escapes. When `nltk.download()` installs a package, the extraction write opens each member's target path without checking whether that path is a hardlink to a file located outside the data root. A local actor who can write inside a shared or predictable NLTK data root (for example `~/nltk_data`, a group-writable `/usr/share/nltk_data`, or a shared container volume) can pre-plant an in-root hardlink at a member path that a soon-to-be-installed package will write. When the victim later runs the download, extraction truncates and overwrites the outside-root target through that hardlink. This is the same weakness class as the previously fixed downloader hardlink issue, but the fix did not reach the package-extraction write sink, so the latest published release remains exploitable through this path.\n\n## Root Cause\n\nThe prior fix added an `st_nlink > 1` refusal to the file-open helpers (`nltk.pathsec.open` / `_hardened_open`) and routed the downloader temporary-file write through that hardened opener, so a multiply-linked inode is refused on those paths. The extraction write sink was never given the same check. On published releases, `nltk.pathsec.ZipFile.extract` validates member names with `validate_zip_archive` and then delegates to the standard library extractor, whose plain `open(targetpath, \"wb\")` opens and truncates a pre-existing hardlink. The containment guard `validate_zip_archive` relies on `Path.resolve()` and name checks; `resolve()` follows symlinks (so a symlinked member is correctly refused) but a hardlink has a legitimate in-root name and in-root resolved path, so it passes. No code on the extraction path performs the `st_nlink` fstat that the sibling open helper performs.\n\n```text\nAffected component: nltk.pathsec (archive extraction), driven by nltk.downloader\nReleased sink (<= 3.10.3): nltk/pathsec.py ZipFile.extract -> stdlib zipfile._extract_member -> open(targetpath, \"wb\")\nContainment guard that fails open for hardlinks: nltk/pathsec.py validate_zip_archive (name checks + Path.resolve())\nDevelopment-branch sink: nltk/pathsec.py ZipFile._extract_member leaf reopen with O_WRONLY|O_TRUNC|O_NOFOLLOW (no st_nlink fstat)\n```\n\n## Impact\n\nAn unprivileged local user who can create a file inside a data root that the victim's NLTK installation will extract into can cause the victim's process to truncate and overwrite a file outside that root. The attacker chooses which outside file is destroyed by selecting the hardlink target, so the integrity impact is complete for the chosen path (arbitrary outside-root file destruction). Where the victim resolves packages through an attacker-influenced mirror or index, the overwritten bytes are also attacker-chosen, which plausibly enables targeted file replacement and later code execution if the victim subsequently consumes the replaced file; that e\n\nAffected: PyPI:nltk\n\nFixed in: 3.10.4\n\nReferences:\nhttps://github.com/nltk/nltk/security/advisories/GHSA-wr3g-j6qj-xpgh\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-128135\nhttps://github.com/nltk/nltk/pull/3753\nhttps://github.com/nltk/nltk/commit/0e9898b7615b4ab3b023e868212316a489ece4f0\nhttps://github.com/nltk/nltk/commit/cf12a5e6a439fe1d722acd53d4309911faaaaf78\nhttps://github.com/nltk/nltk\nhttps://github.com/nltk/nltk/releases/tag/v3.10.4","url":"https://osv.dev/vulnerability/GHSA-wr3g-j6qj-xpgh","published_at":"2026-11-19T23:59:15Z","updated_at":"2026-11-20T00:15:05.398589Z","fetched_at":"2026-11-21T19:15:55.946106Z","severity":"high","cvss_score":7.1,"epss":0.00225,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-128135","vuln_ids":["CVE-2026-128135","GHSA-WR3G-J6QJ-XPGH"],"tags":["osv","pypi","fix-available"],"cluster_id":2128,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10690","html":"https://vulnwatch.ve1ve2.com/item/10690"}},{"id":2348,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-wr3g-j6qj-xpgh / CVE-2026-128135: NLTK: ZIP package extraction follows in-root hardlinks and overwrites files outside the NLTK data root","summary":"NLTK: ZIP package extraction follows in-root hardlinks and overwrites files outside the NLTK data root\n\n## Summary\n\nNLTK ships a security wrapper, `nltk.pathsec.ZipFile`, that is meant to confine archive extraction to trusted data roots and to block link-based escapes. When `nltk.download()` installs a package, the extraction write opens each member's target path without checking whether that path is a hardlink to a file located outside the data root. A local actor who can write inside a shared or predictable NLTK data root (for example `~/nltk_data`, a group-writable `/usr/share/nltk_data`, or a shared container volume) can pre-plant an in-root hardlink at a member path that a soon-to-be-installed package will write. When the victim later runs the download, extraction truncates and overwrites the outside-root target through that hardlink. This is the same weakness class as the previously fixed downloader hardlink issue, but the fix did not reach the package-extraction write sink, so the latest published release remains exploitable through this path.\n\n## Root Cause\n\nThe prior fix added an `st_nlink > 1` refusal to the file-open helpers (`nltk.pathsec.open` / `_hardened_open`) and routed the downloader temporary-file write through that hardened opener, so a multiply-linked inode is refused on those paths. The extraction write sink was never given the same check. On published releases, `nltk.pathsec.ZipFile.extract` validates member names with `validate_zip_archive` and then delegates to the standard library extractor, whose plain `open(targetpath, \"wb\")` opens and truncates a pre-existing hardlink. The containment guard `validate_zip_archive` relies on `Path.resolve()` and name checks; `resolve()` follows symlinks (so a symlinked member is correctly refused) but a hardlink has a legitimate in-root name and in-root resolved path, so it passes. No code on the extraction path performs the `st_nlink` fstat that the sibling open helper performs.\n\n```text\nAffected component: nltk.pathsec (archive extraction), driven by nltk.downloader\nReleased sink (<= 3.10.3): nltk/pathsec.py ZipFile.extract -> stdlib zipfile._extract_member -> open(targetpath, \"wb\")\nContainment guard that fails open for hardlinks: nltk/pathsec.py validate_zip_archive (name checks + Path.resolve())\nDevelopment-branch sink: nltk/pathsec.py ZipFile._extract_member leaf reopen with O_WRONLY|O_TRUNC|O_NOFOLLOW (no st_nlink fstat)\n```\n\n## Impact\n\nAn unprivileged local user who can create a file inside a data root that the victim's NLTK installation will extract into can cause the victim's process to truncate and overwrite a file outside that root. The attacker chooses which outside file is destroyed by selecting the hardlink target, so the integrity impact is complete for the chosen path (arbitrary outside-root file destruction). Where the victim resolves packages through an attacker-influenced mirror or index, the overwritten bytes are also attacker-chosen, which plausibly enables targeted file replacement and later code execution if the victim subsequently consumes the replaced file; that e\n\nAffected packages: pip:nltk\nPatched: nltk 3.10.4","url":"https://github.com/advisories/GHSA-wr3g-j6qj-xpgh","published_at":"2026-11-19T23:59:15Z","updated_at":"2026-11-19T23:59:16Z","fetched_at":"2026-11-21T19:15:18.416768Z","severity":"high","cvss_score":7.1,"epss":0.00225,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-128135","vuln_ids":["CVE-2026-128135","GHSA-WR3G-J6QJ-XPGH"],"tags":["ghsa","pip","CWE-59","CWE-73"],"cluster_id":2128,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2348","html":"https://vulnwatch.ve1ve2.com/item/2348"}},{"id":15177,"source":{"id":"osv","name":"OSV.dev"},"title":"DEBIAN-CVE-2026-128135: NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Proc…","summary":"NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. From 3.9.4 to 3.10.3, NLTK ZIP package extraction can write through an existing in-root hardlink whose other link points outside the NLTK data root. A local attacker who can prepare the extraction target can cause a package member write to overwrite an out-of-root file, violating the pathsec containment boundary and affecting integrity and availability. This issues is fixed in version 3.10.4.\n\nAffected: Debian:12:nltk, Debian:13:nltk, Debian:14:nltk\n\nNo fixed version published yet\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2026-128135","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2026-128135","published_at":"2026-11-19T18:18:05.837000Z","updated_at":"2026-11-22T21:00:05.725287Z","fetched_at":"2026-11-23T03:05:53.019740Z","severity":"high","cvss_score":7.1,"epss":0.00225,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"debian","product":"12:nltk","vuln_id":"CVE-2026-128135","vuln_ids":["CVE-2026-128135","DEBIAN-CVE-2026-128135","GHSA-WR3G-J6QJ-XPGH"],"tags":["osv","debian","no-fix-yet"],"cluster_id":2129,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/15177","html":"https://vulnwatch.ve1ve2.com/item/15177"}},{"id":9028,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-128135: NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Proc…","summary":"NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. From 3.9.4 to 3.10.3, NLTK ZIP package extraction can write through an existing in-root hardlink whose other link points outside the NLTK data root. A local attacker who can prepare the extraction target can cause a package member write to overwrite an out-of-root file, violating the pathsec containment boundary and affecting integrity and availability. This issues is fixed in version 3.10.4.\n\nReferences:\nhttps://github.com/nltk/nltk/commit/0e9898b7615b4ab3b023e868212316a489ece4f0\nhttps://github.com/nltk/nltk/commit/cf12a5e6a439fe1d722acd53d4309911faaaaf78\nhttps://github.com/nltk/nltk/pull/3753\nhttps://github.com/nltk/nltk/releases/tag/v3.10.4\nhttps://github.com/nltk/nltk/security/advisories/GHSA-wr3g-j6qj-xpgh","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-128135","published_at":"2026-11-19T18:18:05.837000Z","updated_at":"2026-11-19T18:18:05.967000Z","fetched_at":"2026-11-21T19:15:31.484682Z","severity":"high","cvss_score":7.1,"epss":0.00225,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-128135","vuln_ids":["CVE-2026-128135","GHSA-WR3G-J6QJ-XPGH"],"tags":["CWE-59","CWE-73"],"cluster_id":2129,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/9028","html":"https://vulnwatch.ve1ve2.com/item/9028"}}]}