---
id: "CVE-2026-0847"
kind: "vulnerability"
aliases: ["CVE-2026-0847", "GHSA-68j8-pq59-fqgm"]
title: "NLTK has a Path Traversal issue"
severity: "high"
cvss: 8.6
epss: 0.01
exploited: false
status: "open"
category: "package"
products: [{"name": "nltk", "fixed": ["3.9.3"], "affected": "<= 3.9.2", "ecosystem": "pypi"}, {"name": "nltk", "fixed": [], "affected": "<= 3.9.2", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["cwe-22", "ml-apis", "nlp-pipelines", "nltk", "package", "python"]
not_affected_if: ["fixed-corpus-paths", "no-user-controlled-file-input"]
published_at: "2026-03-04T19:16:10+00:00"
first_seen_at: "2026-11-04T03:16:03+00:00"
updated_at: "2026-11-04T03:46:40+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-68j8-pq59-fqgm", "first_seen_at": "2026-11-04T03:16:03+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-0847", "first_seen_at": "2026-11-04T03:46:40+00:00"}]
---

# NLTK has a Path Traversal issue

NLTK up to and including 3.9.2 fails to validate file paths in several CorpusReader classes, so user-supplied file names can point outside the intended directory. An attacker who controls those inputs can read sensitive files on the server such as SSH keys and API tokens.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:nltk affected <= 3.9.2 fixed 3.9.3
- vendor:nltk affected <= 3.9.2 fixed ?

## How to check

- Check the installed version with `pip show nltk` and treat anything at or below `3.9.2` as affected.
- Look for code that passes user-controlled file names or paths into WordListCorpusReader, TaggedCorpusReader or BracketParseCorpusReader.

## Fix

- Upgrade NLTK to `3.9.3`.

## Timeline

- 2026-11-04T03:16:03+00:00 ghsa https://github.com/advisories/GHSA-68j8-pq59-fqgm
- 2026-11-04T03:46:40+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-0847

## Documents

- [advisory] Vendor advisory: huntr.com https://huntr.com/bounties/fc69914f-36a9-4c18-8503-10013b39f966

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
