Skip to main content

NLTK PorterStemmer CVE-2026-81722

| EUVDEUVD-2026-67072 HIGH
Inefficient Algorithmic Complexity (CWE-407)
2026-08-27 VulnCheck GHSA-8x48-8g7j-rqxp GHSA-ww6m-cw3f-q94g PYSEC-2026-3738
8.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Identify service accepting untrusted text input
  2. Delivery
    Craft token of ~30k 'y' chars + suffix
  3. Exploit
    Submit via HTTP or API request
  4. Install
    PorterStemmer.stem() invoked on payload
  5. C2
    _measure() triggers O(n²) _is_consonant() calls
  6. Execute
    CPU core pinned for seconds to minutes
  7. Impact
    Service thread unavailable to legitimate users

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Algorithmic complexity limits
Exploitation Conditions

Exploitation requires that the target application calls NLTK's PorterStemmer.stem() on text that includes attacker-controlled tokens without enforcing a maximum token length. This is not a default-configuration attack against NLTK itself - NLTK is a library, not a standalone service, so exploitation depends entirely on how the application integrates it. The specific triggering condition is a single token of approximately 20,000-50,000 characters consisting predominantly of the letter 'y' followed by a recognized English suffix (e.g., 'ness', 'ly'). Applications that pre-tokenize input using standard whitespace splitting are still vulnerable if they do not cap individual token length. Limitations on exploitation: the attack requires network access to an endpoint that invokes PorterStemmer on user input; applications that only stem internal or pre-validated corpora are not exposed; and the impact is bounded to a single CPU core per request on multi-core systems with proper process isolation, which reduces but does not eliminate availability risk. Authentication requirements are not intrinsic to the vulnerability - they depend entirely on whether the exposing application requires authentication, which cannot be determined from library-level CVE data alone.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VA:H) scores 8.7, reflecting that the attack requires no authentication, no special network position, and no user interaction - consistent with the description. The pure availability impact (VC:N/VI:N) is accurate: there is no confidentiality or integrity consequence. The practical exploitability, however, is narrower than a raw CVSS reading suggests: the vulnerable code path is only reachable if the application pipes untrusted, unvalidated input directly into PorterStemmer.stem(), a non-default condition that requires a specific architectural decision by the application developer. Production NLP pipelines often do accept user-supplied text for stemming (search engines, text classifiers, chatbots), so the population of genuinely exposed services is real but not universal. EPSS data is not available in the provided intelligence, and the vulnerability is not listed in CISA KEV, meaning no confirmed active exploitation is on record. The attack payload is low-complexity to construct from the public description - a long string of 'y' characters plus a common English suffix - so the gap between theoretical and practical exploitability is small once an attacker identifies a vulnerable endpoint. Even a mid-sized IT team operating NLP-backed services should treat this as an urgent dependency update rather than a deferred maintenance item, given the trivial construction of the payload. No conflicting signals exist between available data sources; the primary uncertainty is whether a given deployment actually exposes the stemmer to user input.

Exploit ScenarioDerived

An attacker identifies a public-facing web service that accepts free-text input (e.g., a search field, a text analysis API) backed by NLTK's PorterStemmer for term normalization. The attacker submits a single HTTP request containing a token of approximately 30,000 'y' characters followed by the suffix 'ness', causing PorterStemmer.stem() to enter a quadratic computation loop that pins a CPU core for tens of seconds. By sending a low volume of such requests - potentially as few as one per worker thread - the attacker can render the service unresponsive without any authentication. No exploit code needs to be obtained; the attack string is fully derivable from the public CVE description.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 27, 2026

CPU-pinning denial of service in NLTK's PorterStemmer component (versions ≤ 3.10.2) allows a remote unauthenticated attacker to exhaust a CPU core for seconds to minutes by submitting a single crafted token. The root cause is quadratic algorithmic complexity: _is_consonant() re-walks trailing 'y' characters on every invocation, and _measure() calls it once per stem position, resulting in O(n²) processing time. Any service that passes untrusted text through PorterStemmer.stem() without input length validation is vulnerable; a ~20-50 KB payload of repeated 'y' characters followed by a matching suffix such as 'ness' is sufficient to trigger the condition. No public exploit code is identified at time of analysis, but the attack primitive is trivially constructable from the public description. Fix is available in NLTK 3.10.3.

RemediationAI

The primary fix is to upgrade NLTK to version 3.10.3 or later, which resolves the quadratic complexity in PorterStemmer per the vendor security advisory GHSA-ww6m-cw3f-q94g (https://github.com/nltk/nltk/security/advisories/GHSA-ww6m-cw3f-q94g). For environments that cannot immediately upgrade, the most effective compensating control is to enforce a maximum token length before any call to PorterStemmer.stem() - rejecting or truncating tokens above a safe threshold (e.g., 512 characters) eliminates the O(n²) blowup entirely, since legitimate English words are orders of magnitude shorter than the required attack payload. The trade-off of truncation is that extremely long tokens (URLs, technical identifiers) will be stemmed on a prefix only, which may produce incorrect stems in edge cases. Rate-limiting text-processing endpoints and validating that input is plausible natural language (charset, token count, individual token length) are additional layers but are not substitutes for patching. No configuration flag disables the vulnerable code path within NLTK itself - the fix must be applied either at the library level or as a pre-call guard.

Affected VersionsENISA

nltk 0 <3.10.3

Affected Packages

pypi nltk fix: 3.10.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

NLTK (Natural Language Toolkit) is a Python library for natural language processing. The PorterStemmer is an implementation of Martin Porter's 1980 English word-stemming algorithm, used to reduce words to their morphological root. CWE-407 (Insufficient Algorithmic Complexity) describes the root cause: the _is_consonant() helper performs a backward scan over each trailing run of 'y' characters each time it is called, and _measure() - which determines the 'measure' of a stem by counting consonant-vowel sequences - invokes _is_consonant() for every character position. For a token consisting almost entirely of 'y' characters (e.g., 'yyyy...yness'), this produces O(n²) work where n is token length. The CPE cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:* covers the full NLTK package up to and including 3.10.2. The attack surface is any code path that calls PorterStemmer.stem() on attacker-influenced input without first enforcing a maximum token length.

Know when Nltk gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Network-reachable via any exposing application, no authentication or interaction required; impact is pure availability with no confidentiality or integrity consequence.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 7.5 HIGH

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 27, 2026 - 18:02 EUVD
CVE Published
Aug 27, 2026 - 14:51 cve.org
HIGH 8.7

DescriptionCVE.org

nltk PorterStemmer in versions <= 3.10.2 (fixed in 3.10.3) contains an inefficient-algorithmic-complexity denial of service in PorterStemmer.stem(). The _is_consonant() 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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 6,216 pypi packages depend on nltk (3,092 direct, 3,205 indirect)

Ecosystem-wide dependent count for version 3.10.3.

Executive ViewAI

Why It Matters

A computational flaw in NLTK's text stemming component (versions ≤3.10.2) enables attackers to disable services through CPU exhaustion without authentication, affecting any organization using NLTK for search, chatbots, or language processing. A single malicious request can render services unresponsive for minutes, disrupting customer-facing operations and impacting availability SLAs. Teams running production search engines, recommendation systems, or NLP-powered applications should prioritize remediation to prevent incidents and service degradation.

Business Impact: High
Compensating Controls

Apply vendor patch: NLTK 3.10.3. For systems unable to patch immediately: enforce strict input length limits (reject tokens exceeding 1 KB), implement rate limiting on text processing endpoints, add timeout controls to stem() operations, and enable CPU monitoring and alerting on NLTK-processing services.

Threat Intelligence Overview

EPSS Score
0.3%
Top 73% exploitable
Prevalence
Medium
widely used Python NLP library, common in ML and research pipelines
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD 🇯🇵JVN NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

64
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Nltk

View all
CVE-2026-79657 CRITICAL POC
9.3 Aug 25

Arbitrary code execution in the Natural Language Toolkit (NLTK) before 3.10.3 allows attackers to bypass the library's p

CVE-2026-78683 CRITICAL POC
9.4 Aug 25

Arbitrary code execution in NLTK (Natural Language Toolkit) through 3.9.4 allows attackers to run Python code when a vic

CVE-2025-14009 HIGH POC
8.8 Feb 18

Arbitrary code execution in the NLTK (Natural Language Toolkit) Python library affects all versions through its data dow

CVE-2026-63312 HIGH POC
8.7 Aug 22

StreamBackedCorpusView in NLTK before 3.10.0 allows arbitrary local file reads by calling Python's builtins.open() direc

CVE-2026-62384 HIGH POC
8.7 Aug 22

Symlink-based path traversal in NLTK's FramenetCorpusReader before version 3.10.2 permits attackers with write access to

CVE-2026-66393 HIGH POC
8.7 Aug 22

Unbounded recursion in NLTK's JSONTaggedDecoder.decode_obj() (nltk/jsontags.py) allows unauthenticated remote attackers

CVE-2026-62388 HIGH POC
8.7 Aug 22

Path traversal and pickle deserialization protections in NLTK before 3.10.0 are effectively disabled by default - pathse

CVE-2026-78681 HIGH POC
8.7 Aug 25

XML Entity Expansion (Billion Laughs) in NLTK before 3.10.3 allows unauthenticated remote attackers to cause denial of s

CVE-2026-78682 HIGH POC
8.7 Aug 25

Server-side request forgery in NLTK before 3.10.3 allows unauthenticated remote attackers to reach internal HTTP service

CVE-2026-70626 HIGH POC
8.6 Aug 22

Symlink escape in NLTK's CorpusReader.open() allows local attackers to read arbitrary files outside the designated corpu

CVE-2026-62385 HIGH POC
8.2 Aug 22

Path traversal in NLTK's FramenetCorpusReader and NKJPCorpusReader (all versions before 3.10.0) enables unauthenticated

CVE-2021-43854 HIGH POC
7.5 Dec 23

NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research a

Vendor StatusVendor

SUSE

Severity: Important

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy