CVE-2026-80205: NLTK Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-rrv8-h7p8-rx55
CVSS 7.5
CWE-1333
Published
Advisory Summary

CVE-2026-80205 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting NLTK libraries in the PyPI ecosystem. The issue involves redos in nltk.text.text.findall() via unvalidated user-supplied regular expressions. Remediation is available by upgrading affected packages to version 3.10.0.

CVE-2026-80205 at a Glance

CVE Identifier CVE-2026-80205
GHSA Identifier GHSA-rrv8-h7p8-rx55
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product NLTK
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-80205

To remediate this vulnerability, upgrade all affected NLTK dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nltk fixed: 3.10.0
pip install nltk>=3.10.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show nltk

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-80205, inspect your installed packages using pip:

pip show nltk

Analyze the terminal output to locate any version of NLTK in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.10.0), your application is affected.

Note: The pip show nltk command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In NLTK, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```python 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 ```python 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](https://www.offgridsec.com)

CVE-2026-80205 Affected NLTK Versions

1 component(s)
Fixed Versions:
3.10.0
Product / Package Ecosystem Affected Versions Fixed Version
nltk
PyPI
< 3.10.0
3.10.0

References

Frequently Asked Questions

What is CVE-2026-80205?
CVE-2026-80205 is a security vulnerability in NLTK involving ReDoS in nltk.text.Text.findall() via unvalidated user-supplied regular expressions under CWE-1333: Inefficient Regular Expression Complexity.
Which NLTK versions are affected?
Affected versions include releases prior to 3.10.0 across affected packages: nltk.
What version fixes CVE-2026-80205?
Upgrading to 3.10.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nltk affected?
Yes, nltk is affected in releases prior to 3.10.0. Upgrade your dependency to 3.10.0 or later.
What is the CVSS score of CVE-2026-80205?
CVE-2026-80205 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-80205?
CVE-2026-80205 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check PyPI dependencies for CVE-2026-80205?
Run the dependency tree command: 'pip show nltk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rrv8-h7p8-rx55",
  "modified" : "2026-09-08T20:28:13Z",
  "published" : "2026-09-08T20:28:13Z",
  "aliases" : [ "CVE-2026-80205" ],
  "summary" : " NLTK: ReDoS in nltk.text.Text.findall() via unvalidated user-supplied regular expressions",
  "details" : "### Summary\nNLTK'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.\n\n### Affected Code\n`nltk/text.py` — `TokenSearcher.findall()` (line 255) / `Text.findall()` (line 620)\n\n`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:\n\n```python\ndef findall(self, regexp):\n    # Preprocessing does NOT prevent catastrophic backtracking\n    regexp = re.sub(r\"\\s\", \"\", regexp)\n    regexp = re.sub(r\"<\", \"(?:<(?:\", regexp)\n    regexp = re.sub(r\">\", \")>)\", regexp)\n    regexp = re.sub(r\"(?<!\\\\)\\.\", \"[^>]\", regexp)\n\n    # User-controlled regexp executed with no timeout\n    hits = re.findall(regexp, self._raw)\n```\nThe preprocessing transforms `<` and `>` angle-bracket syntax but does not inspect or reject catastrophically backtracking patterns.\n\n### Proof of Concept\n```python\nimport nltk\nimport time\n\n# Token of 25 'a' characters produces self._raw = \"<aaaaaaaaaaaaaaaaaaaaaaaa!>\"\n# The trailing '!' ensures no match, forcing full backtracking.\ntext = nltk.Text([\"a\" * 25 + \"!\"])\n\n# Pattern after transformation:\n#   <  →  (?:<(?:\n#   >  →  )>)\n# Becomes: (?:<(?:((a+)+)b)>)\n# re.findall runs this against \"<aaaaaaaaaaaaaaaaaaaaaaaa!>\" — hangs.\n\nstart = time.time()\ntext.findall(r\"<((a+)+)b>\")   # Never returns\n```\n\n### Impact\nApplications 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.\n\n### Remediation\nThis vulnerability was patched in commit `d8e4753`. Users should update to the patched version.\n\n### Credit\nTool: Kira by [Offgrid Security](https://www.offgridsec.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "nltk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.10.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.9.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nltk/nltk/security/advisories/GHSA-rrv8-h7p8-rx55"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-80205"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nltk/nltk/pull/3674"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nltk/nltk/commit/d8e47539317b571ab1422981f5b9653d5eae1249"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nltk/nltk"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nltk/nltk/releases/tag/v3.10.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3750.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/nltk-before-3.10.0-redos-via-text-findall-unvalidated-regex"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2026/09/01/3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-08T20:28:13Z",
    "nvd_published_at" : null
  }
}