CVE-2026-126301 — Nltk — CWE-400 · CWE-407
CVE-2026-126301 is a MEDIUM severity Denial-of-Service (DoS) vulnerability (CWE-400, CWE-407) (CVSS 5.3/10 (EPSS: 0.5%)) affecting Nltk. Technical vector analysis shows that an attacker can exploit this flaw remotely over the network without authentication (PR:N) with zero user interaction (UI:N), posing a direct security risk to affected deployments.
📄 Official NVD / MITRE Original Record Text
## Summary `LegalitySyllableTokenizer.tokenize` in the NLTK tokenizer package contains an unguarded O(n^2) processing loop. When the method is called on a single token that consists of a long run of vowels (for example `"a" * n`), it consumes CPU time proportional to the square of the token length. An attacker who can supply an untrusted token to this public tokenizer API can force a single request to saturate one CPU core for a prolonged period, degrading availability of any service that syllabifies attacker-controlled text. No authentication, special configuration, or user interaction is required. ## Root Cause The method walks the token in reverse and, on every iteration after the first vowel is seen, evaluates the membership test `char_lower + current_onset[::-1] in self.legal_onsets`. The set `legal_onsets` is built by `onset()`, which returns only the characters up to the first vowel, so every member is vowel-free. For an all-vowel token the first branch can therefore never match, `onset` never becomes `True`, and the reset branch that would clear `current_onset` is never reached. As a result `current_onset` grows by one character on every iteration. Building `current_onset[::-1]` and hashing the resulting string costs O(k) on iteration k, and this is repeated for k from 1 to n, giving total cost O(n^2). The security invariant that is violated is bounded per-token work: there is no length cap on this code path, so untrusted token length translates directly into quadr
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-126301
CVSS 5.3/10 · MEDIUM · 13.11.2026
CWE: CWE-400, CWE-407
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Summary: ## Summary
LegalitySyllableTokenizer.tokenize in the NLTK tokenizer package contains an unguarded O(n^2) processing loop. When the method is called on a single token that consists of a long run of vowels (for example "a" * n), it consumes CPU time proportional to the square of the token length. An attacker who can supply an untrusted token to this public tokenizer API can force a single re…
Affected: nltk
⚡ ATTACK CHAIN
Remotely over internet | no authentication required | no user interaction | low complexity.
🌍 REAL WORLD IMPACT
🛡️ REMEDIATION
→ Apply vendor security update for nltk.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
📋 Routine update cycle (30 days)
────────────────────────────────────────
[Kural Tabanlı Otomatik Güvenlik Analizi]