Impact
NLTK PorterStemmer contains an algorithmic‑complexity flaw that makes its stem() routine run in O(n^2) time for certain inputs. A token composed of a long run of the letter 'y' followed by a matching suffix forces the _is_consonant() helper to scan backward repeatedly, causing the stemmer to consume a CPU core for seconds to minutes. The resulting local or remote denial of service violates system availability and is identified by CWE-407 and CWE-606.
Affected Systems
Python NLTK library, specifically the PorterStemmer component in versions 3.10.2 and earlier. Any application that performs stemming on untrusted text using NLTK, such as web services or data pipelines, is affected. The issue is fixed in NLTK 3.10.3.
Risk and Exploitability
The CVSS score of 8.7 marks this as a high‑severity flaw. While no exploit code is required beyond supplying a crafted word, the vulnerability can be triggered by any untrusted user input that feeds into the stemmer. Identified by CWE-407 and CWE-606, it can be exploited by crafting a long run of the letter 'y' followed by a matching suffix, causing a CPU core to be pinned for seconds to minutes. EPSS is less than 1%, indicating a low but nonzero likelihood of exploitation. The vulnerability is not listed in the CISA KEV catalog, so no known widespread exploitation reports exist yet, but the high impact warrants prompt attention.
OpenCVE Enrichment
Github GHSA