MEDIUMCVSS v3.1 5.5Vulnerability

CVE-2026-128137

> **affected**: PyPI `nltk` `>= 3.9.4` — `CorpusReader.abspaths()`/`abspath()` and the `PlaintextCorpusReader` / `SyntaxCorpusReader` view methods > **dynamically reproduced**: `nltk` `3.9.4` (8/9, scoped-escape checks), `3.10.3` (wheel, 9/9 checks) and `master` `6818767b9` (9/9 checks) --- _Source references (`file:line`) are to commit `303f6e2b` (release tag `v3.10.3`). Line numbers in the released `nltk` wheel match this tag exactly; `master` `6818767b9` contains the same code (pathsec.py renumbered by +44 lines from added hardening comments). In `3.9.4` the same logic exists at earlier line numbers (`api.py:222-236` for `open()`, `api.py:161-203` for `abspath()`/`abspaths()`, `data.py:382-388` for the pointer open, `pathsec.py:105-114` for the scoped branch); the affected code is identical._ ### Summary `CorpusReader.open()` (`nltk/corpus/reader/api.py:235-257`) is NLTK's hardened file-access entry point: after a lexical guard it calls `validate_path(..., required_root=self._root)` (`api.py:246-249`), and the scoped branch of `pathsec.validate_path` (`nltk/pathsec.py:168-179`) resolves symlinks and raises `ValueError` when the resolved target is not inside the corpus root. The view methods do **not** use this entry point: `PlaintextCorpusReader.words/sents/paras` (`nltk/corpus/reader/plaintext.py:67-118`) and `SyntaxCorpusReader.parsed_sents/tagged_sents/sents/tagged_words/words` (`api.py:473-519`) build their streams from `self.abspaths(fileids, ...)` (`api.py:174-217`), which only does a lexical `self._root.join(fileid)` (`nltk/data.py:452-469`) and returns a `FileSystemPathPointer`. That pointer is opened via `FileSystemPathPointer.open()` → `pathsec.open(raw_path, "rb")` with `required_root` left at its default `None` (`data.py:438-447`, `nltk/pathsec.py:752,783`), so only the **global** allowed-roots check runs. The `O_NOFOLLOW` in `_hardened_open` (`pathsec.py:676-731`) protects only the final path component, so an **intermediate-directory symlink insi

Properties

Severity
medium
Summary
NLTK corpus-reader view methods bypass the scoped root sandbox via intermediate-directory symlinks
Nvd fetched at
2026-11-22T12:30:49.958423+00:00
Epss score
0.00158
Cvss severity
MEDIUM
Cvss score
5.5
Retrieved at
2026-11-22T12:32:26+00:00
Ghsa published
2026-11-19T23:56:30Z
Source url
https://github.com/advisories/GHSA-g58v-j9g9-5gfg
Ghsa updated
2026-11-19T23:56:31Z
Ghsa id
GHSA-g58v-j9g9-5gfg
Last source
FIRST EPSS
Score
5.5
Cvss version
3.1
Cve id
CVE-2026-128137
Cvss vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
First seen by Signal
2026-11-19T19:29:21+00:00
Name
CVE-2026-128137
Is ghsa only
false
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Related Entities (3)

AFFECTS (1)

→[Software]pip/nltk

HAS_WEAKNESS (1)

VULNERABLE_TO (1)

←[Software]pip/nltk

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-128137 (CVSS v3.1 5.5) — Ninja Signal Threat Intelligence | Ninja Signal