PyPI: nltk
CVE-2026-54293
Safety vulnerability ID: SFTY-20260616-58930
Affected versions of the Natural Language Toolkit (NLTK) package are vulnerable to Path Traversal due to improper handling of URL-encoded path separators and traversal segments. The `nltk.data.load()` function fails to properly sanitize path inputs before decoding them with `url2pathname()`, allowing encoded traversal patterns to bypass regex checks. An attacker can exploit this vulnerability by providing a specially crafted URL-encoded path, enabling arbitrary file read access on the system, potentially exposing sensitive files such as `/etc/passwd` or `/proc/self/environ`.
Overview
Natural Language Toolkit (NLTK): URL-Encoded Path Traversal in nltk.data.load() Allows Arbitrary Local File Read
Advisory
nltk – Path Traversal
How to Fix
We recommend updating nltk to the latest non-vulnerable version.
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20260616-58930/CVE-2026-54293
- https://github.com/nltk/nltk/security/advisories/GHSA-p4gq-832x-fm9v
- https://nvd.nist.gov/vuln/detail/CVE-2026-54293
- https://github.com/nltk/nltk/pull/3575
- https://access.redhat.com/security/cve/CVE-2026-54293
- https://bugzilla.redhat.com/show_bug.cgi?id=2491486
- https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-2078.yaml
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-54293.json
- https://access.redhat.com/errata/RHSA-2026:42644
- https://github.com/advisories/GHSA-p4gq-832x-fm9v
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
