PyPI: nltk
CVE-2026-0846
Safety vulnerability ID: SFTY-20260309-65600
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.
Overview
NLTK has Arbitrary File Read via Absolute Path Input in nltk.util.filestring()
Advisory
NLTK has Arbitrary File Read via Absolute Path Input in nltk.util.filestring()
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20260309-65600/CVE-2026-0846
- https://nvd.nist.gov/vuln/detail/CVE-2026-0846
- https://huntr.com/bounties/007b84f8-418e-4300-99d0-bf504c2f97eb
- https://github.com/nltk/nltk/pull/3485
- https://github.com/nltk/nltk/commit/b2e1164bf89277f79b65406c829b99fb20ca1974
- https://github.com/advisories/GHSA-h8wq-7xc4-p3qx
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
