CVE-2026-70626: NLTK before 3.9.4 Symlink Escape via CorpusReader
NLTK versions before 3.9.4 contain a symlink escape vulnerability in CorpusReader.open() that allows local attackers to read arbitrary files outside the corpus root. The vulnerability exists because path validation is lexical and does not account for symlink resolution, enabling attackers to place symlinks inside the corpus root to access files outside the intended boundary.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
NLTKto a version that resolves this vulnerability.Fixed in 3.9.4 - Compensating control
Ensure CorpusReader.open() path validation accounts for symlink resolution (i.e., validate the resolved/real path stays within the corpus root) to prevent symlink escape.
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using NLTK versions before 3.9.4 are exposed where a local attacker can create or control symlinks within a corpus root used by CorpusReader.open(). The impact is disclosure of files readable by the affected application outside that corpus root.
What does an attacker need to exploit it?
The attacker needs local access and the ability to place a symlink inside the corpus root. No privileges or user interaction are required according to the supplied vector.
How can this be mitigated if upgrading is not immediately possible?
Prevent untrusted local users or processes from creating, modifying, or placing symlinks in corpus root directories. Restrict filesystem permissions on corpus data and avoid using corpus roots in attacker-writable locations.