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.

Created at: Apr 18, 2026Updated at: Apr 18, 2026

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()

Affected Package

Affecting nltk package, versions
< 3.9.3

Also affects

---

How to Fix

Upgrade
nltk
to
3.9.3
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

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