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

Source: https://junglewise.ai/threats/cve-2026-80206-nltk-tgrep-regular-expression-denial-of-service  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-26. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/nltk). Vendors: [PyPI](https://junglewise.ai/threats/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

  ```sh
  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

- [https://api.github.com/users/infycore](https://api.github.com/users/infycore)
- [https://github.com/infycore](https://github.com/infycore)
- [https://api.github.com/users/infycore/gists%7B/gist_id%7D](https://api.github.com/users/infycore/gists%7B/gist_id%7D)
- [https://api.github.com/users/infycore/repos](https://api.github.com/users/infycore/repos)
- [https://avatars.githubusercontent.com/u/230860773?v=4](https://avatars.githubusercontent.com/u/230860773?v=4)
- [https://api.github.com/users/infycore/events%7B/privacy%7D](https://api.github.com/users/infycore/events%7B/privacy%7D)

## Related threats

- [NLTK WekaClassifier path traversal in model validation](https://junglewise.ai/threats/cve-2026-109956-nltk-through-3-10-3-contains-a-path-traversal-vulnerability-in)
- [NLTK RecursiveDescentParser uncontrolled recursion denial of service](https://junglewise.ai/threats/cve-2026-12876-nltk-recursivedescentparser-uncontrolled-recursion-denial-of)
- [NLTK tgrep regular expression denial of service](https://junglewise.ai/threats/nltk-tgrep-regular-expression-denial-of-service-02fca1b2)
- [NLTK Downloader hardlink filesystem containment bypass](https://junglewise.ai/threats/nltk-downloader-hardlink-filesystem-containment-bypass-522cb97d)
- [NLTK Pl196xCorpusReader quadratic ReDoS on malformed TEI blocks](https://junglewise.ai/threats/nltk-pl196xcorpusreader-quadratic-redos-on-malformed-tei-blocks-8473e6ef)
