CVE-2026-80205 — NLTK: ReDoS in nltk — CVE Details
NLTK: ReDoS in nltk.text.Text.findall() via unvalidated user-supplied regular expressions
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.65%). Schedule for your next planned update.
Does your project use an affected nltk version?
Paste your requirements.txt to check it for CVE-2026-80205 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
NLTK's Text.findall() and TokenSearcher.findall() methods accept user-supplied regular expressions and pass them to the Python re engine without timeout or validation, enabling catastrophic backtracking (ReDoS). This issue is isolated to the nltk.text module and was resolved in a prior commit.
Affected Code
nltk/text.py — TokenSearcher.findall() (line 255) / Text.findall() (line 620)
TokenSearcher.__init__ builds an internal string by wrapping each token in angle brackets. The findall() method preprocesses the caller-supplied regexp and runs it directly against this string with no timeout:
def findall(self, regexp):
# Preprocessing does NOT prevent catastrophic backtracking
regexp = re.sub(r"\s", "", regexp)
regexp = re.sub(r"<", "(?:<(?:", regexp)
regexp = re.sub(r">", ")>)", regexp)
regexp = re.sub(r"(?<!\\)\.", "[^>]", regexp)
# User-controlled regexp executed with no timeout
hits = re.findall(regexp, self._raw)
The preprocessing transforms < and > angle-bracket syntax but does not inspect or reject catastrophically backtracking patterns.
Proof of Concept
import nltk
import time
# Token of 25 'a' characters produces self._raw = "<aaaaaaaaaaaaaaaaaaaaaaaa!>"
# The trailing '!' ensures no match, forcing full backtracking.
text = nltk.Text(["a" * 25 + "!"])
# Pattern after transformation:
# < → (?:<(?:
# > → )>)
# Becomes: (?:<(?:((a+)+)b)>)
# re.findall runs this against "<aaaaaaaaaaaaaaaaaaaaaaaa!>" — hangs.
start = time.time()
text.findall(r"<((a+)+)b>") # Never returns
Impact
Applications that expose Text.findall() to external input are vulnerable to a denial of service. An unauthenticated attacker can cause indefinite CPU saturation with one request, denying service to all other users of the Python process.
Remediation
This vulnerability was patched in commit d8e4753. Users should update to the patched version.
Credit
Tool: Kira by Offgrid Security
Advisory Timeline
- First published September 8, 2026 (79 days ago).
- Last revised September 8, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "nltk>=3.10.0"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| nltk PyPI · Affected: 0.8, 0.9, 0.9.3, 0.9.4 (+61 more) | 3.10.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-1333
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/nltk/nltk/security/advisories/GHSA-rrv8-h7p8-rx55WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-80205ADVISORY
- https://github.com/nltk/nltk/pull/3674WEB
- https://github.com/nltk/nltk/commit/d8e47539317b571ab1422981f5b9653d5eae1249WEB
- https://github.com/nltk/nltkPACKAGE
- https://github.com/nltk/nltk/releases/tag/v3.10.0WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3750.yamlWEB
- https://www.vulncheck.com/advisories/nltk-before-3.10.0-redos-via-text-findall-unvalidated-regexWEB
- https://www.openwall.com/lists/oss-security/2026/09/01/3WEB
Frequently Asked Questions
- What is CVE-2026-80205?
- NLTK: ReDoS in nltk.text.Text.findall() via unvalidated user-supplied regular expressions. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2026-80205?
- CVE-2026-80205 affects nltk. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-80205 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 45.9% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-79657CRITICAL
- CVE-2026-78683CRITICAL
NLTK: Unsafe Pickle Deserialization in TransitionParser Allows Remote Code Execution
- CVE-2026-79674HIGH
- CVE-2026-78681HIGH
NLTK: Entity-expansion DoS (billion laughs) via remaining raw ElementTree parses
- CVE-2026-12252HIGH
NLTK Stanford wrapper classes execute untrusted JAR files without verification
- CVE-2026-126297HIGH
NLTK: Quadratic-time CPU denial of service in ConllCorpusReader SRL instance builder via nested span rescan
- CVE-2026-129221MEDIUM
NLTK: ARFF_Formatter Injects Weka ARFF Schema Directives via Attacker-Controlled Class Labels
- CVE-2026-81723MEDIUM
NLTK: Quadratic CPU Exhaustion in `XMLCorpusView._read_xml_fragment()`