CVE-2026-80206

NLTK 3.10.2 Regular Expression Denial of Service via tgrep

Published Aug 26, 2026 CVSS 4.0 · 8.2 High EPSS < 1% KEV · Not listed
Description
NLTK before 3.10.3 contains a regular expression denial of service (ReDoS) vulnerability in the tgrep module. The _tgrep_node_action function compiles user-supplied regular expressions embedded in /regex/ pattern nodes and executes them via re.search against tree node labels without any validation or timeout. An attacker who controls the tgrep pattern (e.g., via tgrep_positions() or tgrep_compile() exposed to external input) can supply a pattern that triggers catastrophic backtracking, causing indefinite CPU saturation that blocks the Python process.

Analysis

AI-generated

Technical impact

NLTK versions before 3.10.3 are vulnerable to a ReDoS condition in the tgrep module. The internal function that compiles user‑supplied regular expressions does not enforce validation or apply a timeout when matching tree node labels, allowing an attacker to supply a crafted pattern that triggers catastrophic backtracking. The resulting excessive CPU consumption can stall the entire Python process, effectively denying service to legitimate users.

Affected Systems

The vulnerability exists in the NLTK library, specifically before version 3.10.3. Systems that import nltk and use the tgrep functionality, particularly via the exposed tgrep_positions() or tgrep_compile() interfaces, are susceptible. All deployments of NLTK 3.10.2 or earlier that incorporate these features should be reviewed.

Risk and Exploitability

The CVSS score of 8.2 classifies this as High severity. EPSS data is not available, and it is not listed in CISA's KEV catalog, but the lack of mitigation in the library means the vulnerability can be exploited in any environment where an attacker can provide input to the tgrep functions. The primary vector is local or remote code that can invoke these functions with crafted patterns, leading to prolonged CPU usage and potential denial of service.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the NLTK package to version 3.10.3 or later, which removes the vulnerable code.
  • If an upgrade is not immediately feasible, restrict or sanitize all input to the tgrep module; avoid using unvalidated user patterns and consider adding regular expression timeouts or size limits.
  • Apply resource limits or monitor CPU usage for Python processes that use NLTK, and terminate or restart the process if CPU usage spikes beyond normal thresholds.

Generated by OpenCVE AI on August 26, 2026 at 12:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-w3v8-gmh9-3wv7 NLTK: ReDoS in nltk.tgrep via unvalidated user-supplied regular expressions
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description NLTK before 3.10.3 contains a regular expression denial of service (ReDoS) vulnerability in the tgrep module. The _tgrep_node_action function compiles user-supplied regular expressions embedded in /regex/ pattern nodes and executes them via re.search against tree node labels without any validation or timeout. An attacker who controls the tgrep pattern (e.g., via tgrep_positions() or tgrep_compile() exposed to external input) can supply a pattern that triggers catastrophic backtracking, causing indefinite CPU saturation that blocks the Python process.
Title NLTK 3.10.2 Regular Expression Denial of Service via tgrep
First Time appeared Nltk
Nltk nltk
Weaknesses CWE-1333
CPEs cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*
Vendors & Products Nltk
Nltk nltk
References
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'}

cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-1333

    Inefficient Regular Expression Complexity

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Aug 26, 2026, 12:52 PM
Reserved
Aug 25, 2026, 11:15 PM
Status
Analyzed
Published
Aug 26, 2026, 11:16 AM
Modified
Sep 1, 2026, 8:07 PM
Severity
Moderate
Public date
Aug 26, 2026, 10:28 AM