CVE-2026-0846: Nltk NLTK Has Arbitrary File Read Vulnerability
HIGHCVE-2026-0846 is a HIGH (CVSS 8.6) nltk has arbitrary file read vulnerability (CWE-36: Absolute Path Traversal) affecting Nltk libraries in the PyPI ecosystem. The issue involves nltk has arbitrary file read via absolute path input in nltk.util.filestring(). Remediation is available by upgrading affected packages to version 3.9.3.
CVE-2026-0846 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L).
How to Fix CVE-2026-0846
To remediate this vulnerability, upgrade all affected Nltk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install nltk>=3.9.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show nltk
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-0846, inspect your installed packages using pip:
pip show nltk
Analyze the terminal output to locate any version of Nltk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.9.3), your application is affected.
Note: The pip show nltk command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-36: Absolute Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as "/abs/path" that can resolve to a location that is outside of that directory. In Nltk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-0846 Affected Nltk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nltk
|
PyPI |
< 3.9.3
|
3.9.3
|
References
Frequently Asked Questions
What is CVE-2026-0846?
Which Nltk versions are affected?
What version fixes CVE-2026-0846?
Is nltk affected?
What is the CVSS score of CVE-2026-0846?
What CWE is associated with CVE-2026-0846?
How can I check PyPI dependencies for CVE-2026-0846?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h8wq-7xc4-p3qx",
"modified" : "2026-06-08T18:36:48Z",
"published" : "2026-03-09T21:31:38Z",
"aliases" : [ "CVE-2026-0846" ],
"summary" : "NLTK has Arbitrary File Read via Absolute Path Input in nltk.util.filestring()",
"details" : "A vulnerability in the `filestring()` function of the `nltk.util` module in nltk version 3.9.2 allows arbitrary file read due to improper validation of input paths. The function directly opens files specified by user input without sanitization, enabling attackers to access sensitive system files by providing absolute paths or traversal paths. This vulnerability can be exploited locally or remotely, particularly in scenarios where the function is used in web APIs or other interfaces that accept user-supplied input.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "nltk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.9.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-0846"
}, {
"type" : "WEB",
"url" : "https://github.com/nltk/nltk/pull/3485"
}, {
"type" : "WEB",
"url" : "https://github.com/nltk/nltk/commit/b2e1164bf89277f79b65406c829b99fb20ca1974"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nltk/nltk"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-97.yaml"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/007b84f8-418e-4300-99d0-bf504c2f97eb"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-36" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-18T01:14:15Z",
"nvd_published_at" : "2026-03-09T20:16:05Z"
}
}