NLTK has a Path Traversal issue
High8.6CVE-2026-0847 · Published Mar 4, 2026 · updated Jun 8, 2026
A vulnerability in NLTK versions up to and including 3.9.2 allows arbitrary file read via path traversal in multiple CorpusReader classes, including WordListCorpusReader, TaggedCorpusReader, and BracketParseCorpusReader. These classes fail to properly sanitize or validate file paths, enabling attackers to traverse directories and access sensitive files on the server. This issue is particularly critical in scenarios where user-controlled file inputs are processed, such as in machine learning APIs, chatbots, or NLP pipelines. Exploitation of this vulnerability can lead to unauthorized access to sensitive files, including system files, SSH private keys, and API tokens, and may potentially escalate to remote code execution when combined with other vulnerabilities.
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| nltk PyPI | <= 3.9.2 | No fix yet |
Details and references
- CVSS 3.0
- CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-22
- Also known as
- CVE-2026-0847, PYSEC-2026-98
More NLTK advisories
All NLTK| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Mar 19 | Unauthenticated remote shutdown in nltk.app.wordnet_app | High7.5 | 3.9.4 |
| Mar 18 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in nltk | Medium6.1 | 3.9.4 |
| Mar 18 | Natural Language Toolkit (NLTK) has unbounded recursion in JSONTaggedDecoder.decode_obj() may cause DoS | Medium | 3.9.4 |
| Mar 9 | NLTK has Arbitrary File Read via Absolute Path Input in nltk.util.filestring() | High8.6 | 3.9.3 |
| Mar 5 | NLTK: code execution | Critical10.0 | 3.9.3 |
| Feb 18 | NLTK has a Zip Slip Vulnerability | Critical10.0 | 3.9.3 |