CVE-2019-14751: Nltk Path Traversal Vulnerability
HIGHCVE-2019-14751 is a HIGH (CVSS 7.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Nltk libraries in the PyPI ecosystem. The issue involves nltk vulnerable to path traversal. Remediation is available by upgrading affected packages to version 3.4.5.
CVE-2019-14751 at a Glance
Security Impact
CVSS: 7.5
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:N/I:H/A:N).
How to Fix CVE-2019-14751
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.4.5
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-2019-14751, 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.4.5), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted 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-2019-14751 Affected Nltk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nltk
|
PyPI |
< 3.4.5
|
3.4.5
|
References
Frequently Asked Questions
What is CVE-2019-14751?
Which Nltk versions are affected?
What version fixes CVE-2019-14751?
Is nltk affected?
What is the CVSS score of CVE-2019-14751?
What CWE is associated with CVE-2019-14751?
How can I check PyPI dependencies for CVE-2019-14751?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mr7p-25v2-35wr",
"modified" : "2024-10-07T14:49:05Z",
"published" : "2019-08-23T21:53:51Z",
"aliases" : [ "CVE-2019-14751" ],
"summary" : "NLTK Vulnerable To Path Traversal",
"details" : "NLTK Downloader before 3.4.5 is vulnerable to a directory traversal, allowing attackers to write arbitrary files via a `../` (dot dot slash) in an NLTK package (ZIP archive) that is mishandled during extraction.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "nltk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.5"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-14751"
}, {
"type" : "WEB",
"url" : "https://github.com/nltk/nltk/commit/f59d7ed8df2e0e957f7f247fe218032abdbe9a10"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-mr7p-25v2-35wr"
}, {
"type" : "WEB",
"url" : "https://github.com/mssalvatore/CVE-2019-14751_PoC"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nltk/nltk"
}, {
"type" : "WEB",
"url" : "https://github.com/nltk/nltk/blob/3.4.5/ChangeLog"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2019-106.yaml"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QI4IJGLZQ5S7C5LNRNROHAO2P526XE3D"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGZSSEJH7RHH3RBUEVWWYT75QU67J7SE"
}, {
"type" : "WEB",
"url" : "https://salvatoresecurity.com/zip-slip-in-nltk-cve-2019-14751"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00054.html"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-security-announce/2020-04/msg00001.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2019-08-23T21:48:38Z",
"nvd_published_at" : "2019-08-22T16:15:00Z"
}
}