CVE-2026-81722: nltk PorterStemmer before 3.10.3 Quadratic-time DoS

Published Aug 27, 2026
·
Updated

nltk PorterStemmer in versions <= 3.10.2 (fixed in 3.10.3) contains an inefficient-algorithmic-complexity denial of service in PorterStemmer.stem(). The isconsonant() helper walks backward over the entire run of trailing 'y' characters on every call, and measure() invokes it for each stem position, causing O(n^2) behavior. A single ~20-50 KB untrusted token consisting of a long run of the letter 'y' followed by a matching suffix (e.g., 'ness') can pin a CPU core for seconds to minutes, causing availability impact.

Affected Software

1 affected component
nltk/PorterStemmer<=3.10.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade nltk PorterStemmer to a version that resolves this vulnerability.

    Fixed in 3.10.3
  2. Compensating control

    Mitigate availability impact by restricting or throttling requests that supply untrusted tokens with long runs of 'y' (e.g., deny/limit inputs matching a long 'y' run followed by suffix patterns like 'ness') before calling PorterStemmer.stem().

Event History

Aug 27, 2026
CVE Published
via MITRE·02:51 PM
Data Sourced
via MITRE·02:51 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:21 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is realistically exposed to this denial of service?

Applications using nltk PorterStemmer on attacker-controlled or otherwise untrusted tokens are exposed. A single crafted token can consume a CPU core for seconds to minutes.

2

What input is needed to trigger the issue?

An attacker needs to submit a roughly 20–50 KB token containing a long run of the letter "y" followed by a matching suffix, such as "ness". No authentication or user interaction is required according to the supplied vector.

3

Are affected versions fixed, and what should be upgraded?

The issue affects nltk PorterStemmer versions 3.10.2 and earlier and is fixed in version 3.10.3. Upgrade to 3.10.3 to remove the inefficient quadratic-time behavior.

4

What can be done if upgrading is not immediately possible?

Limit the maximum length of untrusted tokens before passing them to PorterStemmer, particularly tokens with long repeated-character runs. This reduces the ability to submit the 20–50 KB crafted inputs described for exploitation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203