Gptline: NLTK: Quadratic-time DoS in PorterStemmer via long runs of 'y' (CVE-2026-81722)
The NLTK PorterStemmer's stem() function has a quadratic-time denial-of-service vulnerability triggered by tokens containing long runs of the letter 'y'. This causes excessive CPU consumption when processing such tokens, impacting availability but not confidentiality or integrity. The issue arises from an iterative function that repeatedly walks backward over runs of 'y's, resulting in O(n^2) complexity. A fix is available to optimize this to linear time.
AI Analysis
Technical Summary
The vulnerability in nltk.stem.PorterStemmer.stem() (CVE-2026-81722) is due to the _is_consonant(word, i) function walking backward over a run of 'y's on every call, causing quadratic time complexity when processing tokens with long runs of 'y'. This leads to denial-of-service by high CPU usage when stemming such tokens, especially those appended with suffixes like 'ness' that trigger the _measure() function. The original recursion error fix introduced this performance regression. The vulnerability affects gptline versions >=1.0.8 and <1.0.8_23. A patch is available to memoize consonant/vowel classification in a single pass, reducing complexity to linear time.
Potential Impact
An attacker can cause a denial-of-service by submitting a single token of approximately 20-50 KB consisting of repeated 'y' characters, causing multi-second to minutes of CPU consumption per request. This impacts single-process availability but does not affect confidentiality or integrity.
Mitigation Recommendations
A patch is available for gptline that addresses this quadratic-time DoS by optimizing the consonant/vowel classification to linear time. Users should apply the official fix to versions >=1.0.8 and <1.0.8_23. No additional mitigation is required beyond applying the patch.
Gptline: NLTK: Quadratic-time DoS in PorterStemmer via long runs of 'y' (CVE-2026-81722)
Description
The NLTK PorterStemmer's stem() function has a quadratic-time denial-of-service vulnerability triggered by tokens containing long runs of the letter 'y'. This causes excessive CPU consumption when processing such tokens, impacting availability but not confidentiality or integrity. The issue arises from an iterative function that repeatedly walks backward over runs of 'y's, resulting in O(n^2) complexity. A fix is available to optimize this to linear time.
CVSS v4.0
Affected software
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
Technical Analysis
The vulnerability in nltk.stem.PorterStemmer.stem() (CVE-2026-81722) is due to the _is_consonant(word, i) function walking backward over a run of 'y's on every call, causing quadratic time complexity when processing tokens with long runs of 'y'. This leads to denial-of-service by high CPU usage when stemming such tokens, especially those appended with suffixes like 'ness' that trigger the _measure() function. The original recursion error fix introduced this performance regression. The vulnerability affects gptline versions >=1.0.8 and <1.0.8_23. A patch is available to memoize consonant/vowel classification in a single pass, reducing complexity to linear time.
Potential Impact
An attacker can cause a denial-of-service by submitting a single token of approximately 20-50 KB consisting of repeated 'y' characters, causing multi-second to minutes of CPU consumption per request. This impacts single-process availability but does not affect confidentiality or integrity.
Mitigation Recommendations
A patch is available for gptline that addresses this quadratic-time DoS by optimizing the consonant/vowel classification to linear time. Users should apply the official fix to versions >=1.0.8 and <1.0.8_23. No additional mitigation is required beyond applying the patch.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-gptline-CVE-2026-81722
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 4.0
Threat ID: 6aac8e5a55bf5e2cf5491af4
Added to database: 09/18/2026, 01:05:30 UTC
Last enriched: 09/18/2026, 01:51:10 UTC
Last updated: 09/18/2026, 02:07:13 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.