PyPI: nltk

CVE-2026-80206

Safety vulnerability ID: SFTY-20260908-92033

Affected versions of the NLTK package are vulnerable to Regular Expression Denial of Service (ReDoS) due to unvalidated user-supplied regular expressions. The `tgrep` module's `_tgrep_node_action()` function compiles user-provided regex literals without validation or execution time constraints, leading to potential catastrophic backtracking. An attacker can exploit this by submitting a specially crafted regex pattern via the `tgrep` API, causing the Python process to hang indefinitely and resulting in a denial-of-service attack.

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

Overview

NLTK: ReDoS in nltk.tgrep via unvalidated user-supplied regular expressions

Advisory

nltk – Regular Expression Denial of Service (ReDoS)

Affected Package

Affecting nltk package, versions
<= 3.10.2

Also affects

---

How to Fix

Upgrade
nltk
to
3.10.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