Dev News Daily ENDE

Eight NLTK advisories: quadratic-time parsers and two file-read escapes, fixed in 3.10.4

GitHub published eight reviewed security advisories for NLTK, the Python natural language toolkit, on 13 and 14 November. All of them name version 3.10.4 as the fix. According to PyPI, that version was uploaded on 21 October and is the current release; users still on 3.10.3 or older remain exposed.

Six of the advisories are about CPU time. The CCG lexicon parser nltk.ccg.lexicon.fromstring consumes a bracket body one character at a time and re-slices the remaining string on every step, so the cost grows with the square of the input; the advisory says a few megabytes of lexicon text can occupy a worker for tens of seconds (CVE-2026-126299, high). Tree.chomsky_normal_form() in its default right-factoring mode calls list.pop(0) in a loop over a node's children, which is also quadratic for one wide node (CVE-2026-126298, high). ConllCorpusReader.srl_instances() rescans every span column once per predicate (CVE-2026-126297, high). TreebankWordTokenizer.span_tokenize slows down quadratically on a long run of double quotes (CVE-2026-126300, medium), and LegalitySyllableTokenizer.tokenize on a token made of a long run of vowels (medium). SteppingRecursiveDescentParser.parse() can run without end on ambiguous or self-embedding grammars: its base class gained a max_time deadline, but the stepping subclass never arms it and its constructor does not accept the parameter (CVE-2026-126303, high).

The other two concern file access. BllipParser passes caller-supplied model paths straight to the bllipparser C extension without NLTK's pathsec validation, which since 3.10.0 confines other tool wrappers to NLTK's data roots, so an attacker-influenced path can read any file (CVE-2026-126295, medium). In YCOECorpusReader, a directory symlink named psd or pos inside a corpus can anchor the nested readers outside the corpus root, because FileSystemPathPointer.join() checks containment lexically and never resolves symlinks (CVE-2026-126304, high).

Each advisory states that no authentication or user interaction is needed, provided an application passes attacker-controlled input to the affected API.

Eight NLTK advisories: quadratic-time parsers and two file-read escapes, fixed in 3.10.4
Eight NLTK advisories: quadratic-time parsers and two file-read escapes, fixed in 3.10.4 — Dev News Daily

Why it matters

The fix has been on PyPI since 21 October, but the advisories that describe what it fixes appeared only on 13 and 14 November. Whether an upgrade is urgent depends on whether a service feeds untrusted text, grammars, corpora or paths to these particular functions.

Primary source
GitHub Advisory Database
https://github.com/advisories/GHSA-89p3-fcch-88ph
Written by Victoria Shinder.