---
id: "CVE-2026-126300"
page: "https://infrastack.ai/live/CVE-2026-126300"
kind: "vulnerability"
aliases: ["CVE-2026-126300"]
title: "NLTK: tokenizer lets long quote-character input exhaust CPU"
severity: "medium"
cvss: 6.9
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["nlp", "nltk", "package", "python"]
not_affected_if: ["no-span-tokenize", "trusted-input-only"]
published_at: "2026-11-13T10:17:34+00:00"
first_seen_at: "2026-11-13T10:47:14+00:00"
updated_at: "2026-11-13T10:54:49+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-126300", "first_seen_at": "2026-11-13T10:47:14+00:00"}]
exploit_sources: []
---

# NLTK: tokenizer lets long quote-character input exhaust CPU

Link for people: https://infrastack.ai/live/CVE-2026-126300 (this .md is for agents)

NLTK's TreebankWordTokenizer.span_tokenize runs in quadratic time because it repeatedly calls list.pop(0) on long runs of double-quote characters. An attacker who submits such text to a service that span-tokenizes untrusted input can use up a CPU core and degrade availability.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed NLTK version with `pip show nltk` or `python -c "import nltk; print(nltk.__version__)"`.
- Search your code for `span_tokenize` calls on user-supplied text, such as `TreebankWordTokenizer`.

## Fix

- NLTK: move to `3.10.4` or later.

## Timeline

- 2026-11-13T10:47:14+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-126300

## Documents

- [advisory] Vendor advisory: github.com https://github.com/nltk/nltk/security/advisories/GHSA-ffr9-mgrr-wcvr
- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/nltk-from-3.2.5-before-3.10.4-cpu-exhaustion-via-treebankwordtokenizer-span-tokenize

## From the sources

NLTK from 3.2.5 before 3.10.4 contains an algorithmic complexity vulnerability in TreebankWordTokenizer.span_tokenize that allows remote attackers to cause quadratic CPU consumption through repeated list.pop(0) calls. Attackers can submit long runs of double-quote characters to services span-tokenizing untrusted text, exhausting a CPU core and degrading availability.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
