Executive brief
NLTK is a widely-used Python library for natural language processing, including corpus reader functionality to process linguistic data files. A vulnerability in the IPIPANCorpusReader component allows an attacker with local filesystem access to read any file the application can access by planting a symbolic link in the corpus directory. This could expose sensitive configuration files, credentials, or other confidential data stored on the system.
Technical details
The vulnerability is a path traversal flaw (CWE-22) affecting the IPIPANCorpusReader class in nltk/corpus/reader/ipipan.py. The root cause is that the _get_tag() method and its callers convert FileSystemPathPointer objects to plain Python strings using string .replace() operations, which discards the security wrapper. These plain strings are then passed directly to Python's builtin open() function, completely bypassing nltk.pathsec validation. An attacker can place a symlink with a name containing no path separators or ".." inside the corpus root; the symlink passes existing traversal checks and is opened directly, allowing arbitrary file reads. The vulnerability requires local filesystem access to plant the symlink and low privileges to call the affected methods, but no user interaction is needed. Exploitation results in confidentiality impact only (file read), with no integrity or availability impact. The fix is to route file access through nltk.pathsec.validate_path() with the corpus root as required_root, similar to fixes already applied to FramenetCorpusReader and NKJPCorpusReader. Version 3.10.2 contains the patch.
Affected products
- NLTK Project NLTK 3.10.0 to 3.10.1
Timeline
- 2026-08-22: disclosed
- 2026: patched: Fixed in version 3.10.2
- 2026-09-02: advisory: Withdrawn as duplicate of GHSA-3hhw-38pf-pxj6