Junglewise Threat Intelligence

CVE-2026-79674: NLTK corpus reader sandbox bypass

CVE-2026-79674 · Severity: high · CVSS 8.8 · Published 2026-09-08

Executive brief

NLTK is a popular Python natural language processing library that implements a filesystem sandbox (pathsec) to restrict corpus readers to a designated data directory. However, certain corpus reader constructors bypass this sandbox check, allowing callers to read files and SQLite databases from anywhere on the filesystem. An attacker who supplies a specially crafted corpus path can exfiltrate sensitive data outside the intended sandbox boundary.

Technical details

This is a path sandbox bypass vulnerability in NLTK's corpus reader API. The root cause is in CorpusReader.__init__(), which converts a raw string root path into a FileSystemPathPointer without validating it against the pathsec sandbox. Subclasses like LinThesaurusCorpusReader and PanLexLiteCorpusReader then use builtin open() or sqlite3.connect() directly on paths derived from this unvalidated pointer, bypassing the guard enforcement in pathsec.open(). No authentication or special privileges are required—any caller who can instantiate these readers with an attacker-controlled root path can read arbitrary files and query SQLite databases on the filesystem. The fix is to validate string roots through the pathsec API before constructing PathPointer objects, and to route all file/database access through pathsec.open() rather than calling builtin open() directly.

Affected products

  • NLTK Project NLTK <= 3.10.2

Timeline

  • 2026-08-11: disclosed
  • 2026-09-08: advisory
  • 2026-09-08: patched: version 3.10.3

References

Related threats