Description
NLTK 3.9.4 through 3.10.2 contains a path traversal vulnerability in CrubadanCorpusReader. _load_lang_ngrams joins the corpus root with crubadan_code, the column-0 value read from the corpus table.txt mapping file, and opens the result with the builtin open() rather than the pathsec-validated opener, so os.path.join discards the root when that value is absolute and the read escapes the corpus directory without the containment check nltk.pathsec applies when ENFORCE is set. An attacker who controls a corpus package can disclose file contents outside the corpus root through lang_freq, limited to paths ending in -3grams.txt whose contents parse as token count lines.
Published: 2026-08-22
Score: 2 Low
EPSS: < 1% Very Low
KEV: No
Impact: Information Disclosure
Action: Patch
AI Analysis

Impact

NLTK versions 3.9.4 through 3.10.2 contain a directory traversal flaw in the CrubadanCorpusReader. The _load_lang_ngrams routine concatenates the corpus root with a value read from the corpus table.txt file and opens the resulting path with the built‑in open() function rather than the pathsec‑validated opener. Because os.path.join removes the root when the value is an absolute path, the code can access files outside the corpus directory. Files ending in –3grams.txt that contain token count lines are exposed, allowing an attacker who can supply a corpus package to read sensitive files on the system. This vulnerability matches CWE‑22 and can lead to untrusted disclosure of local files.

Affected Systems

The affected product is the Natural Language Toolkit (NLTK) library distributed by the nltk vendor. Versions 3.9.4 up to and including 3.10.2 are impacted. Any Python environment that installs one of these releases and loads a corpus using CrubadanCorpusReader is susceptible.

Risk and Exploitability

The CVSS score is 2, indicating low severity, and the vulnerability is not listed in the CISA KEV catalog. EPSS data is unavailable, so the exploitation probability is unknown but unlikely to be high. Exploitation requires the attacker to supply or influence the loading of a corpus package; therefore, the risk is limited to situations where untrusted data packages are imported. The attack surface is confined to files named –3grams.txt that have the correct format, further reducing the overall risk.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to a patched NLTK release (v3.10.3 or later) as soon as it becomes available.
  • Configure the environment variable NLTK_PATHSEC_ENFORCE=1 before importing NLTK to enable pathsec validation for corpus loading.
  • Restrict the loading of custom corpora to trusted sources only, and avoid importing CrubadanCorpusReader from untrusted packages.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-cv22-g7mw-8v73 NLTK CrubadanCorpusReader path traversal allows arbitrary file disclosure
History

Mon, 31 Aug 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Low


Mon, 24 Aug 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Sat, 22 Aug 2026 13:45:00 +0000

Type Values Removed Values Added
Description NLTK 3.9.4 through 3.10.2 contains a path traversal vulnerability in CrubadanCorpusReader. _load_lang_ngrams joins the corpus root with crubadan_code, the column-0 value read from the corpus table.txt mapping file, and opens the result with the builtin open() rather than the pathsec-validated opener, so os.path.join discards the root when that value is absolute and the read escapes the corpus directory without the containment check nltk.pathsec applies when ENFORCE is set. An attacker who controls a corpus package can disclose file contents outside the corpus root through lang_freq, limited to paths ending in -3grams.txt whose contents parse as token count lines.
Title NLTK 3.9.4 through 3.10.2 Path Traversal via CrubadanCorpusReader pathsec Bypass
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': 2.5, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N'}

cvssV4_0

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


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-24T19:18:14.123Z

Reserved: 2026-08-06T20:42:17.835Z

Link: CVE-2026-71514

cve-icon Vulnrichment

Updated: 2026-08-24T19:18:08.013Z

cve-icon NVD

Status : Analyzed

Published: 2026-08-22T14:16:33.560

Modified: 2026-09-02T17:44:12.820

Link: CVE-2026-71514

cve-icon Redhat

Severity : Low

Publid Date: 2026-08-22T13:34:08Z

Links: CVE-2026-71514 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-22T15:15:04Z

Weaknesses
  • CWE-22

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