home / blog
2026-11-22 · medium
CVE-2026-129231: Denial of Service Vulnerability in NLTK
CVE-2026-129231: NLTK vulnerability causes quadratic CPU consumption with files containing very long lines.

CVE-2026-129231 refers to a Denial of Service vulnerability discovered in NLTK (Natural Language Toolkit), an open source Python suite for natural language processing. The issue resides in the SeekableUnicodeStreamReader.readline implementation, which, before version 3.10.4, appended each new block to a growing character buffer and reran splitlines over the entire buffer on every iteration. This behavior causes quadratic CPU consumption when processing files containing a single very long unterminated line.
The vulnerability severity is classified as medium with a CVSS score of 5.3. The vulnerability has been officially patched in version 3.10.4 of NLTK. Signals from GitHub confirm the performance impact: a single 8-million-character file takes approximately 3 seconds in the vulnerable version versus 0.012 seconds in the patched version, dramatically highlighting the quadratic issue.
For defense, companies using NLTK should immediately update to version 3.10.4 or later. For systems that cannot be updated immediately, it is recommended to implement input controls to avoid processing files with excessive sizes or extremely long lines. Strict validation of text files before NLTK processing is also advised, especially if they come from untrusted sources.
At a glance
- What
- Denial of Service vulnerability in SeekableUnicodeStreamReader.readline of NLTK
- Severity
- Medium (CVSS 5.3)
- Affected versions
- Before 3.10.4
- Fix
- Update to version 3.10.4 or later
- Status
- Patched
- Action
- Apply patch and validate file inputs
Sources: NVD, CVE-2026-129231