Inefficient Algorithmic Complexity Affecting nltk package, versions [,3.10.3)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.36% (30th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-NLTK-19639019
  • published7 Sept 2026
  • disclosed27 Aug 2026
  • creditUnknown

Introduced: 27 Aug 2026

NewCVE-2026-81722  (opens in a new tab)
CWE-407  (opens in a new tab)
CWE-606  (opens in a new tab)

How to fix?

Upgrade nltk to version 3.10.3 or higher.

Overview

nltk is a Natural Language Toolkit (NLTK) is a Python package for natural language processing.

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via the PorterStemmer.stem() path in nltk/stem/porter.py. An attacker can pin a CPU core by supplying a single token with a long run of y characters, especially one that reaches stemming logic such as a y...ness input. The vulnerable code calls _is_consonant(word, i) once per character in _measure() and _contains_vowel(), and _is_consonant() walks backward across the same y run on every call. That makes stemming a long y token consume O(n^2) time, delaying or stalling requests that process untrusted text.

CVSS Base Scores

version 4.0
version 3.1