CVE-2026-70626: NLTK: symlink escape allows arbitrary file read

GHSA-r6gq-whwq-mvg9 MEDIUM PoC AVAILABLE CISA: TRACK*
Published September 8, 2026
CISO Take

NLTK's CorpusReader.open() blocks absolute paths and '..' traversal, but never resolves symlinks before checking that a requested file stays inside the configured corpus root, so a symlink planted inside an otherwise-trusted directory lets an attacker read any file the application process can access. This matters because NLTK sits in 2,897 downstream dependents, and any pipeline that treats a corpus or dataset directory as a trust boundary — extracted archives, user-uploaded datasets, shared training data folders — inherits the bypass. There is no CISA KEV listing, no public exploit or Nuclei template, and EPSS sits at 0.2% (bottom of the exploitation-likelihood range), so this is not an active-exploitation emergency; it is a quiet but real sandbox-escape bug (CVSS 6.2, CWE-59). Patch to nltk >= 3.9.4 on your next maintenance window, and until then avoid loading corpus/data directories built from untrusted or attacker-influenced archives, since a single symlink dropped during extraction is enough to trigger the read. Detection-wise, flag symlinks appearing inside corpus/data directories at ingestion time and monitor for unexpected reads of files like /etc/hostname or /proc/self/environ by processes that only should be touching NLTK corpora.

Sources: NVD GitHub Advisory EPSS OpenSSF ATLAS

What is the risk?

Medium severity (CVSS 6.2, local attack vector, no privileges or user interaction required, high confidentiality impact only). Exploitability is low-to-moderate in practice: the attacker needs some ability to place a file (a symlink) inside a directory the target application later treats as an NLTK corpus root — typically via dataset upload, archive extraction, or shared storage rather than remote network access. EPSS (0.2%, bottom decile) and the absence of a KEV listing or public PoC/scanner template both indicate this is not being actively exploited or mass-scanned today. The realistic risk driver is scale: NLTK's broad footprint (2,897 dependents) means many applications may unknowingly rely on CorpusReader as a filesystem trust boundary, making this a supply-chain-adjacent exposure rather than a directly internet-exploitable one.

How does the attack unfold?

Malicious Corpus Delivery
Attacker supplies a dataset/corpus archive containing a symlink that, once extracted, sits inside the application's configured corpus root but points outside it.
AML.T0010.002
Symlink Traversal
The application calls CorpusReader.open() on a file ID that lexically appears inside the root; NLTK's normpath-based check passes because it never resolves the symlink.
AML.T0037
Arbitrary File Read
The OS resolves the symlink at open time and returns contents of a file outside the corpus root — secrets, configs, or system files readable by the app user.
AML.T0037
Data Exposure
The leaked content reaches the attacker through the application's normal output channel (returned data, logs, or error messages), completing the disclosure.
AML.T0025

What systems are affected?

Package Ecosystem Vulnerable Range Patched
HF Datasets pip <= 3.9.3 3.9.4
22.0K OpenSSF 6.2 2.9K dependents Pushed 8d ago 86% patched ~19d to patch Full package profile →

Do you use HF Datasets? You're affected.

How severe is it?

CVSS 3.1
6.2 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 11% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Moderate
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Local
AC Low
PR None
UI None
S Unchanged
C High
I None
A None

What should I do?

1 step
  1. Upgrade to nltk >= 3.9.4, which resolves the symlink-before-boundary-check issue (fixed via PR #3522 / GHSA-r6gq-whwq-mvg9). Until patched, do not point CorpusReader/nltk.data at directories built from untrusted archives, user uploads, or any location where an attacker could have planted a symlink (e.g., dataset zips extracted without sanitization). Where corpora are built from external sources, extract archives with a tool that strips or rejects symlinks, and run corpus-consuming processes with least-privilege filesystem access (containerized, read-only mounts limited to the actual corpus data) so a successful escape has minimal blast radius. For detection, add a periodic or ingestion-time scan for symlinks inside configured corpus roots, and alert on file reads outside the expected corpus directory tree if your environment supports filesystem auditing (auditd/eBPF).

What does CISA's SSVC say?

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.7 - Data for AI systems
NIST AI RMF
MAP 2.3 - Third-party resources and components are identified and risk-assessed
OWASP LLM Top 10
LLM05 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2026-70626?

NLTK's CorpusReader.open() blocks absolute paths and '..' traversal, but never resolves symlinks before checking that a requested file stays inside the configured corpus root, so a symlink planted inside an otherwise-trusted directory lets an attacker read any file the application process can access. This matters because NLTK sits in 2,897 downstream dependents, and any pipeline that treats a corpus or dataset directory as a trust boundary — extracted archives, user-uploaded datasets, shared training data folders — inherits the bypass. There is no CISA KEV listing, no public exploit or Nuclei template, and EPSS sits at 0.2% (bottom of the exploitation-likelihood range), so this is not an active-exploitation emergency; it is a quiet but real sandbox-escape bug (CVSS 6.2, CWE-59). Patch to nltk >= 3.9.4 on your next maintenance window, and until then avoid loading corpus/data directories built from untrusted or attacker-influenced archives, since a single symlink dropped during extraction is enough to trigger the read. Detection-wise, flag symlinks appearing inside corpus/data directories at ingestion time and monitor for unexpected reads of files like /etc/hostname or /proc/self/environ by processes that only should be touching NLTK corpora.

Is CVE-2026-70626 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2026-70626, increasing the risk of exploitation.

How to fix CVE-2026-70626?

Upgrade to nltk >= 3.9.4, which resolves the symlink-before-boundary-check issue (fixed via PR #3522 / GHSA-r6gq-whwq-mvg9). Until patched, do not point CorpusReader/nltk.data at directories built from untrusted archives, user uploads, or any location where an attacker could have planted a symlink (e.g., dataset zips extracted without sanitization). Where corpora are built from external sources, extract archives with a tool that strips or rejects symlinks, and run corpus-consuming processes with least-privilege filesystem access (containerized, read-only mounts limited to the actual corpus data) so a successful escape has minimal blast radius. For detection, add a periodic or ingestion-time scan for symlinks inside configured corpus roots, and alert on file reads outside the expected corpus directory tree if your environment supports filesystem auditing (auditd/eBPF).

What systems are affected by CVE-2026-70626?

This vulnerability affects the following AI/ML architecture patterns: training pipelines, data pipelines, RAG pipelines.

What is the CVSS score for CVE-2026-70626?

CVE-2026-70626 has a CVSS v3.1 base score of 6.2 (MEDIUM). The EPSS exploitation probability is 0.21%.

What is the AI security impact?

Affected AI Architectures

training pipelinesdata pipelinesRAG pipelines

MITRE ATLAS Techniques

AML.T0010.002 Data
AML.T0025 Exfiltration via Cyber Means
AML.T0037 Data from Local System

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.7
NIST AI RMF: MAP 2.3
OWASP LLM Top 10: LLM05

What are the technical details?

Original Advisory

### Summary `nltk.corpus.reader.api.CorpusReader.open()` can be used to read files outside the intended corpus root via a symlink placed inside that root. Although NLTK blocks absolute paths and `..` traversal, the current boundary check is only lexical and does not account for symlink resolution. This leads to an arbitrary local file read / filesystem sandbox bypass for applications that rely on `CorpusReader` or `FileSystemPathPointer` to restrict file access. ### Details The vulnerable flow is: - [`nltk/corpus/reader/api.py:222`](/mnt/Data/my_brains/test/nltk/nltk/corpus/reader/api.py#L222) - `CorpusReader.open()` blocks absolute paths and `..`, then calls `self._root.join(file).open()` - [`nltk/data.py:398`](/mnt/Data/my_brains/test/nltk/nltk/data.py#L398) - `FileSystemPathPointer.join()` joins the requested file ID and checks whether the resulting path still appears to remain under the configured root The problem is that the check is based on the lexical path after `os.path.normpath()`, not on the resolved path after following symlinks. Current behavior: 1. `CorpusReader.open()` rejects: - absolute paths - `..` path traversal 2. `FileSystemPathPointer.join()` computes: - `joined = os.path.normpath(os.path.join(self._path, fileid))` - `root = os.path.normpath(self._path)` 3. It allows the access if `joined` starts with `root` This misses the case where a path stays inside the root lexically, but resolves outside the root via a symlink already present under the allowed directory. Example: ```text JOINED=/tmp/nltk-root/link/secret.txt REALPATH=/tmp/outside/secret.txt ``` `JOINED` still appears to be inside the root, but `REALPATH` is outside it. This is distinct from simple `../` traversal: - the file ID is not absolute - the file ID does not contain `..` - the escape only happens after filesystem resolution of a symlink under the allowed root ### PoC Reproduced in an isolated Docker sandbox using the local `nltk` clone. Minimal Python PoC: ```python import os import tempfile from nltk.corpus.reader.api import CorpusReader root = tempfile.mkdtemp(prefix="nltk-root-") outside_dir = tempfile.mkdtemp(prefix="nltk-out-") outside_file = os.path.join(outside_dir, "secret.txt") with open(outside_file, "w") as f: f.write("secret-data") os.symlink(outside_dir, os.path.join(root, "link")) corpus = CorpusReader(root, ["link/secret.txt"]) with corpus.open("link/secret.txt") as f: print(f.read()) ``` Observed result: ```text secret-data ``` Docker re-test output: ```text ROOT=/tmp/nltk-root-jjxay3if OUTSIDE_DIR=/tmp/nltk-out-1kef36e0 JOINED=/tmp/nltk-root-jjxay3if/link/secret.txt REALPATH=/tmp/nltk-out-1kef36e0/secret.txt READ_OK=secret-data INSIDE_ROOT=True REAL_INSIDE_ROOT=False ``` Additional impact validation using a system file: ```text ROOT=/tmp/nltk-root-_h5x4m19 JOINED=/tmp/nltk-root-_h5x4m19/hostfile REALPATH=/etc/hostname HOSTNAME_READ=48dafb244af3 INSIDE_ROOT=True REAL_INSIDE_ROOT=False ``` This shows that the issue is not limited to attacker-created files outside the root; it can also read existing system files that are readable by the application user. ### Impact This is an arbitrary local file read / symlink escape issue. Who is impacted: - applications that accept attacker-controlled corpus directories, extracted datasets, or package contents - applications that rely on NLTK corpus readers as a trust boundary for file access - any deployment where an attacker can place or influence files inside the allowed corpus root Practical impact includes disclosure of: - application secrets stored on disk - local configuration files - private datasets - process-exposed files such as `/proc/self/environ` - system files readable by the running user The issue is best described as a filesystem sandbox bypass caused by improper link resolution before file access.

Exploitation Scenario

An application lets users upload a custom NLP corpus or dataset archive for training or search indexing, which the backend extracts into a directory later passed to NLTK's CorpusReader. The attacker crafts the archive so that, on extraction, it creates a symlink inside the corpus root pointing to an absolute path outside it (e.g., '/etc' or the application's config directory). The application later calls corpus.open('link/secret.txt') as part of normal processing; NLTK's lexical boundary check sees a path that still 'looks' inside the root and allows it, but the OS resolves the symlink and returns the contents of the attacker-chosen target file — exposing API keys, database credentials, or other tenants' data to the attacker via whatever channel echoes the corpus content back (search results, processed output, error messages, logs).

Weaknesses (CWE)

CWE-59 — Improper Link Resolution Before File Access ('Link Following'): The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

  • [Architecture and Design] Follow the principle of least privilege when assigning access rights to entities in a software system. Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Timeline

Published
September 8, 2026
Last Modified
September 8, 2026
First Seen
September 8, 2026

Related Vulnerabilities