Denial of Service in nltk PorterStemmer Affects Python Natural Language Toolkit
CVE-2026-81722

8.7HIGH

Key Information:

Vendor

Nltk

Status
Vendor
CVE Published:
27 August 2026

What is CVE-2026-81722?

The nltk PorterStemmer, in versions prior to 3.10.3, is susceptible to a denial of service vulnerability due to inefficient algorithmic complexity in its stem() function. The _is_consonant() helper function traverses a sequence of 'y' characters each time it's called, while the _measure() function invokes it for each stem position, leading to O(n^2) behavior. An attacker can exploit this vulnerability by providing a crafted input, consisting of a lengthy string of 'y' characters followed by a matching suffix (e.g., 'ness'), which can significantly burden a CPU core, causing long delays and potential service unavailability.

Affected Version(s)

nltk 0 < 3.10.3

nltk 3.10.3

References

CVSS V4

Score:
8.7
Severity:
HIGH
Confidentiality:
None
Integrity:
None
Availability:
High
Attack Vector:
Network
Attack Complexity:
Low
Attack Required:
None
Privileges Required:
Undefined
User Interaction:
None

Timeline

  • Vulnerability published

  • Vulnerability Reserved

.