All vulnerabilities

PyPI

CVE-2026-129233

NLTK: StreamBackedCorpusView constructor os.stat leaks out-of-root file existence, size, and mtime bypassing pathsec ENFORCE

Severity
Medium 5.3
Published
19 Nov 2026
Last changed
20 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
3.10.4
Exploit chance
0.4% in the next 30 daysHigher than 34% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Information exposure (CWE-200)Sensitive information in files or directories (CWE-538)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read some data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Also known as
GHSA-w674-vqhw-g3pg
Sources
OSV.dev and GitHub

Description

StreamBackedCorpusView, a public API in nltk/corpus/reader/util.py, applies the pathsec sandbox to the file content it reads but not to the file metadata it probes in its constructor. When the view is created with a plain string fileid, init calls os.stat(self._fileid).st_size with no pathsec validation, so an application that passes an attacker influenced path to the constructor discloses whether an arbitrary out of root file exists and, if it does, its exact byte size and modification time, even when nltk.pathsec.ENFORCE is True. This is the residual metadata channel left open by the fix for CVE-2026-63312 (GHSA-x5ph-mj9p-rfr8), which closed arbitrary content read on the same code path but did not bring the sibling os.stat under the sandbox.

The pathsec sandbox is intended to confine all NLTK filesystem access to allowed data roots. The fix for CVE-2026-63312 enforced this for content reads by routing StreamBackedCorpusView._open through nltk.pathsec.open (_secure_open).

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
nltkPyPI · osv:PyPI:nltk
  • From 3.10.0 before 3.10.4

About nltk

Weekly downloads (PyPI)
11,948,568PyPI Stats, 23 Nov 2026

References