Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. nltk
  4. ›
  5. CVE-2026-63312

CVE-2026-63312: NLTK: StreamBackedCorpusView Bypasses pathsec.ENFORCE - Arbitrary Local File Read

September 8, 2026

Setting nltk.pathsec.ENFORCE = True is documented to sandbox all file access to allowed NLTK data directories and raise PermissionError on unauthorized access. However, StreamBackedCorpusView opens files via builtins.open() directly, bypassing pathsec.validate_path() entirely. An attacker who can influence the fileid argument can read arbitrary local files regardless of the ENFORCE setting.

References

  • github.com/advisories/GHSA-x5ph-mj9p-rfr8
  • github.com/nltk/nltk/commit/674ea75accdf08eca3782dee0a9c4ed7e0d0025b
  • github.com/nltk/nltk/pull/3588
  • github.com/nltk/nltk/releases/tag/v3.10.0
  • github.com/nltk/nltk/security/advisories/GHSA-x5ph-mj9p-rfr8
  • github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3730.yaml
  • nvd.nist.gov/vuln/detail/CVE-2026-63312
  • www.vulncheck.com/advisories/nltk-streambackedcorpusview-bypasses-pathsec-enforce-arbitrary-file-read

Code Behaviors & Features

Detect and mitigate CVE-2026-63312 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 3.10.0

Fixed versions

  • 3.10.0

Solution

Upgrade to version 3.10.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

pypi/nltk/CVE-2026-63312.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:41 +0000.