Skip to main content

NLTK CVE-2026-71514

| EUVDEUVD-2026-64295 LOW
Path Traversal (CWE-22)
2026-08-22 VulnCheck GHSA-cv22-g7mw-8v73
2.0
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Compromise or craft malicious corpus package
  2. Delivery
    Inject absolute path into table.txt crubadan_code
  3. Exploit
    Application calls lang_freq() on attacker-chosen language code
  4. Execution
    os.path.join discards corpus root prefix
  5. Impact
    Read 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.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

nltk 3.9.4 <3.10.3

Affected Packages

pypi nltk fix: 3.10.3

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

Vendor (VulnCheck) PRIMARY 2.0 LOW
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
vuln.today AI 2.5 LOW

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.

3.1 AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
4.0 AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 190 pypi packages depend on nltk (45 direct, 145 indirect)

Ecosystem-wide dependent count for version 3.9.4.

Threat Intelligence Overview

EPSS Score
0.2%
Top 95% exploitable
Prevalence
Medium
widely used Python NLP library in research, academia, and data science
Data Quality
7 sources
Confidence: High

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

10
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

More in Nltk

View all
CVE-2026-79657 CRITICAL POC
9.3 Aug 25

Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p

CVE-2026-78683 CRITICAL POC
9.4 Aug 25

Arbitrary code execution in NLTK (Natural Language Toolkit) through 3.9.4 allows attackers to run Python code when a vic

CVE-2025-14009 HIGH POC
8.8 Feb 18

Arbitrary code execution in the NLTK (Natural Language Toolkit) Python library affects all versions through its data dow

CVE-2026-63312 HIGH POC
8.7 Aug 22

StreamBackedCorpusView in NLTK before 3.10.0 allows arbitrary local file reads by calling Python's builtins.open() direc

CVE-2026-62384 HIGH POC
8.7 Aug 22

Symlink-based path traversal in NLTK's FramenetCorpusReader before version 3.10.2 permits attackers with write access to

CVE-2026-66393 HIGH POC
8.7 Aug 22

Unbounded recursion in NLTK's JSONTaggedDecoder.decode_obj() (nltk/jsontags.py) allows unauthenticated remote attackers

CVE-2026-62388 HIGH POC
8.7 Aug 22

Path traversal and pickle deserialization protections in NLTK before 3.10.0 are effectively disabled by default - pathse

CVE-2026-78681 HIGH POC
8.7 Aug 25

XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of s

CVE-2026-78682 HIGH POC
8.7 Aug 25

Server-side request forgery in NLTK before 3.10.3 allows unauthenticated remote attackers to reach internal HTTP service

CVE-2026-70626 HIGH POC
8.6 Aug 22

Symlink escape in NLTK's CorpusReader.open() allows local attackers to read arbitrary files outside the designated corpu

CVE-2026-62385 HIGH POC
8.2 Aug 22

Path traversal in NLTK's FramenetCorpusReader and NKJPCorpusReader (all versions before 3.10.0) enables unauthenticated

CVE-2021-43854 HIGH POC
7.5 Dec 23

NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research a

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy