Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessControl tab_dir argument exposed by application
-
ExploitSupply path outside permitted data root
-
ExecutionVulnerable function calls built-in open() bypassing pathsec
-
ImpactRead or overwrite files beyond sandbox boundary
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V5 - File Handling File name/path control
|
| Exploitation Conditions | Exploitation requires an application that (1) calls nltk.classify.maxent.load_maxent_params() or save_maxent_params() with a tab_dir value derived from attacker-influenced input, and (2) relies on nltk.pathsec (ENFORCE=True) as its filesystem security boundary - the advisory explicitly states the flaw is that these functions call Python's built-in open() directly instead of the pathsec-aware opener, so pathsec.ENFORCE=True does not contain them. Limiting factors: impact is bounded by the NLTK process's own filesystem permissions; deployments that do not use pathsec as a boundary, or never pass untrusted data into tab_dir, are not meaningfully exposed; the save-side defect is only present up to and including 3.10.3, while the load side was already hardened in 3.9.4/3.10.3. |
| Impact | This is a moderate-severity issue, not a top-priority emergency. The supplied CVSS 4.0 vector (AV:N/AC:H/AT:N/PR:N/UI:N) scores 6.3 (Medium), and the key limiter is AC:H - exploitation is not against a default, standalone attack surface but depends on an application wiring attacker-influenced input into the tab_dir argument while relying on nltk.pathsec as a filesystem boundary. The vuln.today decision label is 'this_month' (not act_now/emergency), it is NOT on CISA KEV, and no EPSS score was provided - together these signal a real but non-urgent fix-in-maintenance-window item rather than mass exploitation. A public PoC reference exists in the GHSA advisory; it is not verified as working weaponized exploit code, and PoC availability must not be conflated with active exploitation. One notable conflict: the GHSA summary and description state arbitrary file READ as well as write, yet the supplied CVSS 4.0 vector sets VC:N (no confidentiality impact), which appears to understate the information-disclosure dimension - treat the confidentiality rating as likely too low. Also note CWE differs by source (NVD-style CWE-73 external control of filename vs GHSA CWE-22 path traversal). Overall: a legitimate sandbox-bypass defect worth patching promptly, but real-world risk is gated by whether a deployment actually depends on pathsec enforcement and exposes tab_dir to untrusted control. |
| Exploit ScenarioDerived | An application that uses NLTK and treats nltk.pathsec (ENFORCE=True) as its filesystem containment boundary exposes load_maxent_params()/save_maxent_params() with a tab_dir value influenced by untrusted input. The attacker supplies a tab_dir pointing outside the permitted data root, causing load_maxent_params() to read arbitrary files (e.g. weights.txt/mapping.tab paths resolved outside the sandbox) or save_maxent_params() to create/overwrite arbitrary files, all bounded by the NLTK process's filesystem permissions. The GHSA advisory includes a PoC demonstrating that pathsec.open() rejects the outside-root path while the vulnerable functions reach it via direct built-in open(). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 13, 2026
Path traversal in NLTK's maxent model-parameter helpers lets caller-controlled input escape the nltk.pathsec filesystem sandbox: save_maxent_params() and load_maxent_params() build paths from the tab_dir argument and open them with Python's built-in open() rather than the pathsec-aware opener, so pathsec.ENFORCE=True does not contain the access. All releases up to and including 3.10.3 carry the save-side defect, while the load side was already hardened in 3.9.4 and 3.10.3; the vendor fix ships in 3.10.4. Real exposure is narrow - an application must pass attacker-influenced data into tab_dir and rely on pathsec as its security boundary - and impact is capped by the NLTK process's own filesystem permissions, which is consistent with the moderate assessed score; a reproduction outline accompanies the advisory, but it is not verified as working exploit code, and there is no KEV entry or public exploit identified at time of analysis.
RemediationAI
Vendor-released patch: upgrade to NLTK 3.10.4 (for example pip install --upgrade 'nltk>=3.10.4'), which contains the save-side commit 2a92b7182 on top of the load-side fix already present since 3.9.4; note that at the time the advisory note was written no release tag contained 2a92b7182, so confirm the installed version against the 3.10.4 tag before relying on it, and track https://github.com/nltk/nltk/security/advisories/GHSA-59f9-gqg8-mqpj for the authoritative fix and release status. Updating is the complete fix because the defect is that these two functions bypass the pathsec opener entirely. If upgrading is not immediately possible, treat tab_dir as untrusted input: derive it only from a fixed allow-list of directory names rather than from request data, and normalize and confine it (os.path.realpath plus a check that the result still sits beneath an approved root) before calling either function - this adds an application-side validation step that must be maintained and leaves a small window between check and open. Applications that never enable pathsec or that run these helpers with trusted, code-controlled tab_dir values are not meaningfully exposed, but running the NLTK process under a least-privilege account limits the blast radius of any traversal at the cost of restricting which data roots the model can legitimately load from.
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 ships a module called nltk.pathsec that is documented as the mechanism for confining filesystem access to permitted data roots, with strict enforcement intended to block unauthorized reads and writes when pathsec.ENFORCE is set. The affected code lives in nltk/classify/maxent.py: load_maxent_params() derives <tab_dir>/weights.txt, <tab_dir>/mapping.tab, <tab_dir>/labels.txt and <tab_dir>/alwayson.tab, and save_maxent_params() creates or overwrites the parameter files under the same tab_dir. Neither function routes those paths through pathsec, so the sandbox is simply skipped. The GitHub advisory classifies this as CWE-22 (path traversal) while the CVE record uses CWE-73 (external control of file name or path); both describe the same root cause - a security-relevant path assembled from an externally supplied directory name and handed straight to the native file API. The load-side hardening (commit f2556f9e1) makes load_maxent_params read through open_datafile on a PathPointer whose open is pathsec.open, and is contained in tag 3.9.4 and every later tag. The save-side hardening (commit 2a92b7182, PR #3759 'Harden maxent / named-entity model-artifact saves against shared-tmp planting', merged 2026-08-18, merge commit a167e94bc) validates tab_dir and writes every parameter file through pathsec.open; at the time of the advisory note no release tag contained it. A security probe added alongside PR #3753 also lets load_maxent_params accept a plain str or Path via FileSystemPathPointer, and the same probe run against develop reports that a str or Path tab_dir raises AttributeError before any file is opened - a crash rather than a containment bypass, since nothing is read or written.
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:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
AC:H because exploitation needs attacker-controlled tab_dir plus reliance on pathsec enforcement; PR:N as the functions need no auth; C:L/I:L for bounded arbitrary read/write.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
NLTK before 3.10.4 contains a path traversal vulnerability in save_maxent_params() and load_maxent_params() that bypasses the pathsec filesystem restriction mechanism. Attackers who control the tab_dir argument can read or overwrite model parameter files outside permitted data roots, because the functions call Python's built-in open() directly.
Blast Radius
ecosystem impact- 6,309 pypi packages depend on nltk (3,111 direct, 3,281 indirect)
Ecosystem-wide dependent count for version 3.10.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
CPU exhaustion in NLTK's ConllCorpusReader.srl_instances() lets an attacker who supplies a crafted CoNLL SRL corpus pin
CPU exhaustion in NLTK's Tree.chomsky_normal_form() right-factor binarization affects NLTK through 3.10.3 and lets remot
Quadratic CPU exhaustion in NLTK's CCG lexicon parser (nltk.ccg.lexicon.fromstring, also re-exported as nltk.ccg.chart.f
Denial of service in NLTK before 3.10.4 allows remote attackers to pin a CPU core and exhaust bounded worker pools by ca
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
EUVD-2026-125225
GHSA-59f9-gqg8-mqpj
NVD
CVE.org
EPSS
Exploit-DB