Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCompromise or craft malicious corpus package
-
DeliveryInject absolute path into table.txt crubadan_code
-
ExploitApplication calls lang_freq() on attacker-chosen language code
-
Executionos.path.join discards corpus root prefix
-
ImpactRead target file contents outside corpus directory
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the attacker control the content of a Crubadan corpus package loaded by NLTK, specifically the table.txt mapping file, and be able to insert an absolute path as the crubadan_code (column-0) value. The application must then call lang_freq() or otherwise trigger _load_lang_ngrams() against the attacker-influenced language code. The file read is constrained to targets whose resolved path ends in -3grams.txt and whose contents parse as token-count lines - non-matching files will cause a parse error, not a silent read. Local access is required (AV:L), and specific attack prerequisites (AT:P) include successful placement of the malicious corpus. This is not exploitable against default NLTK installations consuming only official NLTK corpus data; corpus supply-chain control is a hard prerequisite. |
| Impact | The CVSS 4.0 score of 2.0 with vector AV:L/AC:H/AT:P/PR:N/UI:P accurately reflects the narrow exploitation window: exploitation requires local access, high attack complexity, specific attack prerequisites (attacker control over a loaded corpus package), and passive user interaction. The confidentiality impact is low (VC:L), bounded by the -3grams.txt filename constraint and token-count parse requirement. No KEV listing, no EPSS data, and no public POC are available, all consistent with a vulnerability that demands corpus supply-chain control as a precondition. This is not a broadly exploitable network vulnerability; the real-world threat surface is limited to environments that consume untrusted NLTK corpus packages from third-party or unverified sources. The gap between the technical CWE-22 classification and actual exploitability is significant - defenders should patch as part of normal dependency hygiene rather than treating this as an emergency, unless their deployment specifically processes untrusted corpus data. |
| Exploit ScenarioDerived | An attacker who can supply a malicious NLTK Crubadan corpus package - for example, via a compromised third-party corpus mirror or a dependency confusion attack on a shared corpus store - crafts a table.txt file containing an absolute path such as /proc/self/environ-3grams.txt as the crubadan_code column-0 value. When a downstream Python application calls lang_freq() for that language code, NLTK opens the targeted system file and exposes its contents to the caller. No public proof-of-concept exploit exists at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 22, 2026
Path traversal in NLTK's CrubadanCorpusReader (versions 3.9.4 through 3.10.2) allows an attacker who controls a malicious corpus package to read arbitrary file contents outside the corpus root directory via the lang_freq interface. The vulnerability arises because _load_lang_ngrams bypasses NLTK's pathsec containment by calling the builtin open() instead of the pathsec-validated opener, enabling os.path.join to silently discard the corpus root prefix when an absolute path is supplied as the crubadan_code value. No public exploit exists and no KEV listing is present; a vendor patch is available in 3.10.3.
RemediationAI
Upgrade NLTK to version 3.10.3 or later, which patches the vulnerability by replacing all affected open() calls with pathsec_open() and adding required_root enforcement across CrubadanCorpusReader, IPIPANCorpusReader, LinThesaurusCorpusReader, MTEFileReader, and the ACE file loader. The upstream patch commit is available at https://github.com/nltk/nltk/commit/10d34b3f4fe3fec74b76527a409eb0acbac2e8ab. If immediate upgrade is not possible, restrict NLTK corpus loading to only trusted, verified corpus packages by auditing all sources supplying table.txt files to CrubadanCorpusReader; do not process corpus packages from unverified third-party repositories. Note that setting the NLTK pathsec ENFORCE flag does not mitigate this specific vulnerability in pre-patch versions, because the affected code path bypasses pathsec entirely by calling the builtin open() directly.
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
The affected code in nltk/corpus/reader/crubadan.py (lines 90-98 in v3.10.2) reads a language code (crubadan_code) from column 0 of the corpus table.txt mapping file and constructs a file path via os.path.join(corpus_root, crubadan_code). Because it then calls the builtin open() rather than NLTK's own pathsec_open(), the containment check enforced by nltk.pathsec (which applies O_NOFOLLOW and hardlink guards when ENFORCE is set) is never reached for this code path. CWE-22 applies directly: Python's os.path.join silently discards all preceding components when a later component is an absolute path, so a crafted crubadan_code value of /etc/passwd causes the join to return /etc/passwd, escaping the corpus root entirely. The read is constrained to filenames ending in -3grams.txt that parse as token-count lines, limiting but not eliminating information disclosure. The fix (commit 10d34b3f4fe3fec74b76527a409eb0acbac2e8ab) replaces open() with pathsec_open() throughout crubadan.py, named_entity.py, ipipan.py, lin.py, and mte.py, adding required_root=self.root to enforce containment. CPE: cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*.
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:H/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Local vector and high complexity reflect mandatory corpus supply-chain control; no-privilege attacker requires user interaction to trigger corpus load; low confidentiality with no integrity or availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
NLTK 3.9.4 through 3.10.2 contains a path traversal vulnerability in CrubadanCorpusReader. _load_lang_ngrams joins the corpus root with crubadan_code, the column-0 value read from the corpus table.txt mapping file, and opens the result with the builtin open() rather than the pathsec-validated opener, so os.path.join discards the root when that value is absolute and the read escapes the corpus directory without the containment check nltk.pathsec applies when ENFORCE is set. An attacker who controls a corpus package can disclose file contents outside the corpus root through lang_freq, limited to paths ending in -3grams.txt whose contents parse as token count lines.
Blast Radius
ecosystem impact- 190 pypi packages depend on nltk (45 direct, 145 indirect)
Ecosystem-wide dependent count for 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
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
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
Symlink escape in NLTK's CorpusReader.open() allows local attackers to read arbitrary files outside the designated corpu
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-64295
GHSA-cv22-g7mw-8v73
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB