Description
NLTK before 3.10.0 contains an arbitrary local file read vulnerability in StreamBackedCorpusView that bypasses pathsec.ENFORCE by calling builtins.open() directly instead of pathsec.open(). Attackers who control the fileid argument can read arbitrary local files regardless of the ENFORCE setting, including sensitive system files and application credentials.
Published: 2026-08-22
Score: 8.7 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability allows an attacker who can supply the fileid argument to the StreamBackedCorpusView class in NLTK to read arbitrary files from the local filesystem. By calling builtins.open() instead of the library’s pathsec.open() wrapper, the code bypasses the ENFORCE check that normally restricts access to safe paths. This flaw is a classic directory traversal or path traversal issue (CWE‑22) and can expose sensitive system files and credentials that the process has permission to read.

Affected Systems

Any project that depends on the NLTK library before version 3.10.0 is affected. The vulnerability is present in all products that import nltk and use the StreamBackedCorpusView class without upgrading to 3.10.0 or later.

Risk and Exploitability

The CVSS score of 8.7 indicates high severity. Although an EPSS score is not available and the flaw is not listed in the CISA KEV catalog, the likelihood of exploitation remains significant for attackers who can influence the fileid argument. The flaw is local in nature; it does not require network access but still demands knowledge of the library usage and the ability to manipulate function arguments.

Generated by OpenCVE AI on August 22, 2026 at 15:27 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the NLTK library to version 3.10.0 or newer.
  • Audit the code to ensure that all file access is performed via the library’s pathsec.open() or equivalent sandboxed function and remove any direct builtins.open() calls that use user-controlled arguments.
  • Verify that the application’s configuration maintains path security enforcement and that no other components bypass it with low-level file operations.

Generated by OpenCVE AI on August 22, 2026 at 15:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sat, 22 Aug 2026 14:30:00 +0000

Type Values Removed Values Added
Description NLTK before 3.10.0 contains an arbitrary local file read vulnerability in StreamBackedCorpusView that bypasses pathsec.ENFORCE by calling builtins.open() directly instead of pathsec.open(). Attackers who control the fileid argument can read arbitrary local files regardless of the ENFORCE setting, including sensitive system files and application credentials.
Title NLTK StreamBackedCorpusView Bypasses pathsec.ENFORCE Arbitrary File Read
First Time appeared Nltk
Nltk nltk
Weaknesses CWE-22
CPEs cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*
Vendors & Products Nltk
Nltk nltk
References
Metrics cvssV3_1

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

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-22T14:12:40.731Z

Reserved: 2026-07-16T12:13:18.733Z

Link: CVE-2026-63312

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-22T15:16:19.367

Modified: 2026-08-22T15:16:19.367

Link: CVE-2026-63312

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-22T15:30:05Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')