CVE-2026-126303: NLTK SteppingRecursiveDescentParser unbounded CPU consumption

A high-severity vulnerability in NLTK's SteppingRecursiveDescentParser allows attackers to pin CPU cores indefinitely by supplying ambiguous grammars and short inputs, bypassing the timeout protections present in the base parser class.

Christopher Ort
By i10X News Desk · Reviewed by Christopher Ort · 3 min read
Share
A server room with a single rack-mounted server glowing red from overheating, surrounded by normal equipment in a dimly lit data center
Image: AI-generated, i10X
On this page
  1. Quick Take
  2. In plain English
  3. What happened
  4. What you should do
  5. What it means
  6. Sources

A vulnerability in the Natural Language Toolkit (NLTK) allows an attacker to cause unbounded CPU consumption by exploiting a parser that lacks timeout protections. The flaw affects version 3.10.3 and was patched in version 3.10.4.

i10X Quick Take

Quick Take

  1. What: SteppingRecursiveDescentParser.parse() in NLTK performs unbounded searches on ambiguous grammars with no time limit
  2. Who is affected: Applications using NLTK 3.10.3 that parse attacker-influenced grammars with SteppingRecursiveDescentParser
  3. Severity: High (CVSS 7.5), can cause denial of service by pinning CPU cores indefinitely
  4. Fixed in: NLTK version 3.10.4
  5. What to do: Update to NLTK 3.10.4 or later

In plain English

NLTK is a popular Python library for working with human language data. One of its components, a parser called SteppingRecursiveDescentParser, has a flaw where it can get stuck in an infinite loop when processing certain types of grammar rules. If an attacker can control the grammar rules and provide a short input, they can make the parser run forever and consume 100% of a CPU core.

What you should do: If you use NLTK in your code, update to version 3.10.4. If you don’t use NLTK or this specific parser, you can ignore this issue.

What happened

The SteppingRecursiveDescentParser class in NLTK performs top-down parsing of context-free grammars. Unlike its base class RecursiveDescentParser, which includes a max_time parameter to enforce a wall-clock deadline (default 5.0 seconds), the stepping subclass overrides the parse() method with its own loop that never checks this deadline.

The stepping parser’s parse() method calls initialize() and then runs while self.step() is not None, driving its own step loop without arming or consulting the inherited _parse_deadline or _max_time attributes. Its __init__ signature omits the max_time parameter entirely, so callers cannot enable or configure a timeout.

When given an ambiguous or self-embedding grammar (such as S -> 'a' S S | 'a') and a short input sequence, the parser enumerates a derivation space that grows on the order of Catalan numbers with no memoization. The GitHub advisory provides a proof-of-concept showing that while the base parser raises TimeoutError after about 2 seconds on 17 tokens, the stepping parser never returns.

An attacker who can influence the grammar and supply input to a service using this parser can force a single parse() call to pin a CPU core indefinitely. In deployments with bounded worker pools, repeated requests exhaust the pool and deny service to legitimate users. No authentication or user interaction is required.

The vulnerability was assigned CVE-2026-126303 and GHSA-8FX7-8JR8-84RV. It affects NLTK version 3.10.3 and was fixed in version 3.10.4. The stepping parser is primarily used for debugging and interactive stepping (backing a GUI), so real-world exposure is narrower than for the base parser, though parse() is a supported public method.

What you should do

Update NLTK to version 3.10.4 or later using pip:

3.10.4
pip install --upgrade nltk

If you cannot update immediately, avoid using SteppingRecursiveDescentParser on untrusted grammars or inputs. Consider using the base RecursiveDescentParser with an explicit max_time parameter instead.

What it means

This vulnerability demonstrates how timeout protections can be inadvertently bypassed in subclasses that override control flow. The stepping parser was designed for interactive use cases where a developer manually steps through parsing states, but its parse() method is a public API that behaves as a full parser without inheriting the safety bounds of its parent class.

The fix in version 3.10.4 likely adds timeout enforcement to the stepping parser’s loop or exposes the max_time parameter in its constructor. Organizations using NLTK for parsing untrusted input should audit their code to ensure they are not using the stepping parser in production contexts where an attacker could supply crafted grammars.

Sources

Christopher Ort

Christopher Ort

Christopher Ort is the editor of i10X News at i10x.ai. He has worked hands-on with AI tools, models and agent workflows for years and leads i10X’s coverage of AI launches, funding and research. He is the author of “The Style Penalty”, an SSRN study on how frontier AI models judge AI-written CVs, covered by heise online and t3n.

Editor's picks

  1. Georgia Tech’s Academic AI Playbook: 20 Lessons From 67 Real Courses, Free to Reuse
  2. Arcfront’s $1B Run Rate: What the AI Data Startup Confirms and What It Doesn’t
  3. GPT-6.2 Astra Tops Blueprint-Bench 2, 70% Above May Leader GPT-5.5
  4. Deutsche Telekom Puts 100 Million Euros Into Mistral for Sovereign AI in Germany
  5. Inkling 2 Mini: Thinking Machines’ Looped Open Model Tops Qwen on Coding Tests