HIGH 7.5 GitHub
CVE-2026-12072
Natural Language Toolkit (NLTK): Path Traversal in NKJPCorpusReader leads to Arbitrary File Read and bypasses the nltk.pathsec sandbox (ENFORCE=True)
### Summary
A path-traversal vulnerability in `NKJPCorpusReader` allows an attacker who can
influence the `fileids` argument of its public read methods (`header`, `raw`,
`words`, `sents`, `tagged_words`) to read files outside the corpus root. The
reader builds the file path with no containment check and opens it with the
builtin `open()`, so it bypasses NLTK's `nltk.pathsec` sandbox — including the
strict `ENFORCE = True` mode that `SECURITY.md` recommends for web/multi-tenant
Affected Products
- pip/nltk <= 3.9.4
References
- https://github.com/advisories/GHSA-6hm5-jgcp-p838
- https://github.com/nltk/nltk/security/advisories/GHSA-6hm5-jgcp-p838
- https://github.com/advisories/GHSA-6hm5-jgcp-p838
This high severity vulnerability with a CVSS score of 7.5 was published on 2026-07-31 via GitHub. Affected: pip/nltk <= 3.9.4.
vulnfeed aggregates 9166 vulnerabilities from NVD, CISA KEV,
Ubuntu, Debian, Red Hat, Kubernetes, Exploit-DB, OSS-Security, GitHub and OpenStack — updated every 4 hours.