CVE-2026-80206: NLTK tgrep regular expression denial of service

CVE-2026-80206 · Severity: high · CVSS 5.9 · Published 2026-08-26

NLTK's tgrep module is a natural language processing tool that searches parse trees using pattern matching syntax. The module accepts user-supplied regular expressions without validation or timeouts, allowing an attacker to craft a malicious regex pattern that causes exponential backtracking (ReDoS). A single crafted request can hang the entire Python process indefinitely, denying service to all other users sharing the process.

Technologies: nltk (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-80206 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-80206 being exploited in the wild.
How severe is CVE-2026-80206?
High severity, with a CVSS score of 5.9, published 26 August 2026.
Which products and versions are affected?
nltk (PyPI) <= 3.10.2, ECOSYSTEM:introduced=0,fixed=3.10.3.
Is there a fix for CVE-2026-80206?
Yes. nltk (PyPI): upgrade to 3.10.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-80206 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-80206?
Check whether you run nltk (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • nltk (PyPI): upgrade to 3.10.3 or later
    pip install "nltk>=3.10.3"

Technical details

The vulnerability exists in nltk/tgrep.py in the _tgrep_node_action() function (around line 320), which compiles embedded regex literals directly from user input without validation. When a tgrep pattern contains a /regex/ node, the function calls re.compile(node_lit) directly and applies the compiled regex via r.search() against tree node labels. The attacker controls node_lit entirely through tgrep_positions() or tgrep_compile() entry points. Vulnerable to ReDoS through patterns like /((a+)+)b/ matching a string of repeated 'a' characters with no 'b' present, causing exponential backtracking. No authentication is required; the attack vector is network-accessible in web API deployments (Flask, FastAPI). Patch available in version 3.10.3; affected versions are &lt;= 3.10.2.

Affected products

  • NLTK NLTK <= 3.10.2

Identifiers

  • CVE-2026-80206
  • GHSA-w3v8-gmh9-3wv7
  • PYSEC-2026-3751

Timeline

  • 2026-09-08: disclosed: GitHub Advisory published
  • 2026: patched: Patched in version 3.10.3

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.