Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Natural Language Toolkit (NLTK): ReDoS in NLTK ReviewsCorpusReader FEATURES regex (CVE-2026-12061)

0
High
Published: 07/31/2026 (07/31/2026, 16:51:09 UTC)
Source: GCVE Database
Product: nltk

Description

Natural Language Toolkit (NLTK) versions prior to 3.10.0 contain a Regular Expression Denial of Service (ReDoS) vulnerability in the ReviewsCorpusReader's FEATURES regex. The vulnerable regex uses an unbounded greedy pattern to extract feature annotations, which on long bracket-less lines causes quadratic backtracking and high CPU consumption. This can hang functions like reviews(), features(), and sents() when processing crafted input lines. The issue allows denial of service by stalling processing on a single malicious review line without requiring authentication or privileges.

CVSS v3.1

Score 7.5high

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

Affected software

PyPIghsa
nltk
Affected versions
<3.10.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/31/2026, 19:48:31 UTC

Technical Analysis

The ReviewsCorpusReader in NLTK uses a module-level FEATURES regex to extract feature annotations formatted as a label followed by a bracketed signed digit (e.g., label[+2]). The label sub-pattern is an unbounded greedy run of word-plus-whitespace groups followed by a word, which must be followed by a literal '['. On input lines that are long sequences of words without brackets, the regex engine performs quadratic backtracking due to repeated failed attempts to match the bracket at each position. This results in O(n²) CPU time relative to the line length, causing the reader functions to hang on a single crafted line. A fix was introduced by bounding the number of word-plus-whitespace groups, reducing the complexity to linear time while preserving extraction correctness on realistic data.

Potential Impact

An attacker can cause denial of service by supplying a single crafted review line with a very long sequence of words and no bracketed annotation. Processing this line with ReviewsCorpusReader functions (reviews(), features(), sents()) results in excessive CPU consumption and hanging of the processing thread or process. No authentication or privileges are required, so any user-supplied or untrusted corpus can be used to trigger this condition, potentially stalling multi-tenant pipelines or batch jobs.

Mitigation Recommendations

A patch is available that introduces a bound on the number of word-plus-whitespace groups in the FEATURES regex, preventing quadratic backtracking. Users should upgrade to NLTK version 3.10.0 or later where this fix is applied. Until patched, avoid processing untrusted or user-supplied review corpora that may contain long bracket-less lines. The vendor advisory confirms a fix is available.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-fg7f-2386-8897
Osv Schema Version
1.4.0
Aliases
["CVE-2026-12061"]
Ecosystems
["PyPI"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a6cf7f1bf32cb7a342b3ed2

Added to database: 07/31/2026, 19:30:57 UTC

Last enriched: 07/31/2026, 19:48:31 UTC

Last updated: 07/31/2026, 19:48:31 UTC

Views: 1

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses