PyPI: nltk

CVE-2026-80205

Safety vulnerability ID: SFTY-20260908-36021

Affected versions of the NLTK package are vulnerable to Regular Expression Denial of Service (ReDoS) due to unvalidated user-supplied regular expressions. The `nltk.text.Text.findall()` and `nltk.text.TokenSearcher.findall()` methods pass user-controlled regular expressions directly to the Python `re` engine without implementing a timeout or validation mechanism, leading to potential catastrophic backtracking. An attacker can exploit this vulnerability by providing a specially crafted regular expression that triggers excessive backtracking, resulting in indefinite CPU saturation and denial-of-service for applications that expose these methods to external input.

Created at: Sep 9, 2026Updated at: Sep 9, 2026

Overview

NLTK: ReDoS in nltk.text.Text.findall() via unvalidated user-supplied regular expressions

Advisory

nltk – Regular Expression Denial of Service (ReDoS)

Affected Package

Affecting nltk package, versions
<= 3.9.4

Also affects

---

How to Fix

Upgrade
nltk
to
3.10.0
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