CVE-2026-79674
PoC massPath sandbox bypass in NLTK corpus readers allows outside-root file and DB reads
NLTK's corpus-reader base constructor converts an attacker-influenced string root into a FileSystemPathPointer without any nltk.pathsec validation, so readers such as LinThesaurusCorpusReader and PanLexLiteCorpusReader call builtin open() and sqlite3.connect() directly on derived paths and never hit the sandbox guard that pathsec.open() enforces. An attacker who can supply or influence the corpus root path passed to these readers can make the process read files or SQLite databases outside the sanctioned data root even with pathsec ENFORCE=True, gaining access beyond the intended boundary (CVSS 4.0 rates confidentiality impact high and integrity impact low). Exposure is concentrated in deployments that rely on the nltk.pathsec sandbox as a security boundary and pass untrusted or user-controlled root paths to corpus readers; typical offline NLTK usage with self-managed corpora is not meaningfully affected. The flaw was verified in NLTK 3.10.2 (commit 474af1f5) on Python 3.13.14; no in-the-wild exploitation is known, it is not listed in CISA KEV, and EPSS assigns roughly a 0.2% probability of exploitation within 30 days.
What to do: Audit whether user- or externally controlled root paths reach NLTK corpus readers (especially LinThesaurusCorpusReader and PanLexLiteCorpusReader) while you rely on nltk.pathsec with ENFORCE=True, and canonicalize/validate roots against the sanctioned sandbox root before constructing readers. No fixed release is stated in the available data, so track NLTK's PyPI/GitHub for a patch adding pathsec validation to CorpusReader.__init__ and treat pathsec boundaries for these readers as bypassable until then; if you do not use pathsec sandboxing, this issue has little practical impact.
| NLTK project (PyPI package 'nltk') NLTK — nltk.corpus.reader (CorpusReader base; LinThesaurusCorpusReader; PanLexLiteCorpusReader) | 3.10.2 (confirmed by testing; no broader affected range or fixed version stated in the available data) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
NLTK versions before 3.10.3 contain a path sandbox bypass vulnerability in corpus-reader constructors that allows attackers to read files outside the intended data root. Attackers can supply arbitrary corpus root paths to LinThesaurusCorpusReader and PanLexLiteCorpusReader constructors to access filesystem content and SQLite databases outside the pathsec sandbox boundary.
- Vendors
- nltk
- Products
- nltk
- Ecosystems
- pip
- Weakness
- CWE-73
- Vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- GHSA
- GHSA-3gq4-3j92-5w49 (high)
In the news0 stories
No ingested article mentions this CVE yet.