Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain local write access to corpus directory
-
DeliveryCreate symlink targeting sensitive file outside corpus root
-
ExploitTrigger NLTK CorpusReader.open() on symlink path
-
ExecutionLexical boundary check passes, OS resolves symlink
-
ImpactSensitive file contents returned to NLTK caller
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Symlink resolution safety
|
| Exploitation Conditions | Exploitation requires that the attacker have write access to the corpus root directory or any of its subdirectories on the host filesystem, enabling symlink creation. The vulnerable NLTK application must then invoke CorpusReader.open() on a path that resolves - via the attacker's symlink - to a file outside the corpus boundary. Purely remote attackers with no local filesystem write access cannot exploit this vulnerability. No special NLTK configuration or non-default feature flag is required: any application using the CorpusReader API on a system where untrusted local users share write access to the corpus directory is exposed. The scope of readable files is bounded by the OS-level permissions of the process executing NLTK - only files that process can open are accessible via the symlink escape. |
| Impact | The provided CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H) scores 8.6, but several metrics are in tension with the vulnerability description. AV:L correctly reflects that symlink placement requires local filesystem write access. However, VI:H (high integrity impact) and VA:H (high availability impact) are not supported by the description, which describes only arbitrary file read; no write or crash primitive is documented. These ratings appear to be conservatively estimated rather than empirically confirmed and should be verified against the vendor advisory at GHSA-r6gq-whwq-mvg9. VC:H is well-supported: the NLTK process may read any file it has OS-level permission to access, potentially exposing application secrets, private keys, or OS credential files. No EPSS score was provided in the intelligence data; the vulnerability is absent from the CISA KEV catalog, and no proof-of-concept code has been identified, indicating no confirmed active exploitation. The local attack vector is the primary limiting factor: purely remote attackers with no write access to the corpus directory cannot exploit this flaw. Real-world risk is most acute in multi-tenant environments, CI/CD pipelines with shared corpus directories, or containerized deployments where untrusted users have write access to NLP data paths. |
| Exploit ScenarioDerived | An attacker with write access to an NLTK corpus directory - for example, a low-privileged user on a shared NLP workstation or a compromised CI build step - creates a symbolic link named corpus_file.txt inside the corpus root pointing to /etc/shadow or an application's .env secrets file. When the NLTK application subsequently calls CorpusReader.open('corpus_file.txt'), the lexical path check passes because the symlink's path string is within the corpus root; the OS resolves the link, and NLTK returns the contents of the sensitive target file to the caller. No public proof-of-concept has been identified, but the technique is a well-understood class of local privilege escalation and requires no specialized tooling beyond the ability to run ln -s. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 22, 2026
Symlink escape in NLTK's CorpusReader.open() allows local attackers to read arbitrary files outside the designated corpus root, affecting all versions before 3.9.4. Path boundary validation is performed lexically on the string representation of a path rather than on the resolved filesystem target, so an attacker with write access to the corpus directory can plant a symlink that passes the check yet redirects reads to sensitive files anywhere the host process can access. No public exploit has been identified at time of analysis, and a vendor-released patch is available in version 3.9.4.
RemediationAI
The primary remediation is to upgrade NLTK to version 3.9.4 or later, which resolves the symlink escape by performing proper symlink resolution (os.path.realpath() or equivalent) before path boundary validation inside CorpusReader.open(); the vendor advisory at https://github.com/nltk/nltk/security/advisories/GHSA-r6gq-whwq-mvg9 confirms patch availability. For environments where immediate upgrade is not possible, restrict write permissions on the corpus root and all subdirectories to the dedicated service account running NLTK (e.g., chmod 750 on the corpus root owned by the NLTK service user), eliminating any untrusted local user's ability to plant symlinks; note this does not fix the underlying validation flaw and requires ongoing permission auditing. Alternatively, run NLTK workloads in isolated containers or virtual environments with corpus directories mounted read-only for all principals except a single provisioning step, which removes the attacker's write surface entirely but may complicate corpus update workflows.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
NLTK (Natural Language Toolkit, CPE cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*) is the dominant Python platform for computational linguistics and NLP workflows. The flaw is classified as CWE-59 (Improper Link Resolution Before File Access, 'Link Following'): CorpusReader.open() evaluates whether a requested path is inside the corpus root using lexical string operations - for example, checking that the path starts with the corpus root prefix - without first resolving symbolic links via os.path.realpath() or equivalent. An attacker who can write to any subdirectory of the corpus root can create a symlink whose string path satisfies the lexical check while the OS-level link target lies outside the intended boundary. When NLTK follows the symlink at open time, it reads the external file transparently, bypassing the boundary entirely.
Know when Nltk gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Symlink placement requires corpus-directory write access (PR:L, AV:L); only file read is described, so I:N and A:N.
AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
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.
Blast Radius
ecosystem impact- 190 pypi packages depend on nltk (45 direct, 145 indirect)
Ecosystem-wide dependent count for version 3.9.4.
Executive ViewAI
NLTK (Natural Language Toolkit) versions prior to 3.9.4 contain a path traversal vulnerability allowing attackers with write access to corpus directories to read arbitrary files accessible to the application process. Organizations using affected NLTK versions risk unauthorized disclosure of sensitive data, including application credentials, configuration files, and customer data.
Apply vendor patch: version 3.9.4
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p
Arbitrary code execution in NLTK (Natural Language Toolkit) through 3.9.4 allows attackers to run Python code when a vic
Arbitrary code execution in the NLTK (Natural Language Toolkit) Python library affects all versions through its data dow
StreamBackedCorpusView in NLTK before 3.10.0 allows arbitrary local file reads by calling Python's builtins.open() direc
Symlink-based path traversal in NLTK's FramenetCorpusReader before version 3.10.2 permits attackers with write access to
Unbounded recursion in NLTK's JSONTaggedDecoder.decode_obj() (nltk/jsontags.py) allows unauthenticated remote attackers
Path traversal and pickle deserialization protections in NLTK before 3.10.0 are effectively disabled by default - pathse
XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of s
Server-side request forgery in NLTK before 3.10.3 allows unauthenticated remote attackers to reach internal HTTP service
Path traversal in NLTK through version 3.10.3 allows attackers who control caller-supplied file paths to read or write f
Path traversal in NLTK's FramenetCorpusReader and NKJPCorpusReader (all versions before 3.10.0) enables unauthenticated
NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research a
EUVD-2026-64314
GHSA-8h9m-22mv-qv5r
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB