---
id: "CVE-2026-126303"
page: "https://infrastack.ai/live/CVE-2026-126303"
kind: "vulnerability"
aliases: ["CVE-2026-126303"]
title: "NLTK: parser has no time limit, so crafted grammars can pin CPU"
severity: "high"
cvss: 8.7
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "nltk", "fixed": [], "affected": "", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["nltk", "package", "python"]
not_affected_if: ["no-untrusted-grammars", "parser-not-used"]
published_at: "2026-11-13T10:17:35+00:00"
first_seen_at: "2026-11-13T10:47:15+00:00"
updated_at: "2026-11-13T10:50:27+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-126303", "first_seen_at": "2026-11-13T10:47:15+00:00"}]
exploit_sources: []
---

# NLTK: parser has no time limit, so crafted grammars can pin CPU

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

NLTK's SteppingRecursiveDescentParser.parse() has no deadline or step limit, so it can run without bound on certain inputs. An attacker who can influence the grammar and token input can pin CPU cores and exhaust worker pools, causing denial of service.

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

## Affected

- pypi:nltk affected range not listed fixed no fixed version listed

## How to check

- Check the installed NLTK version with `pip show nltk` and compare it against the fixed release.
- Search your code for calls to `SteppingRecursiveDescentParser` or `parse()` on grammars that come from users or other untrusted input.

## Fix

- NLTK: move to `3.10.4` or later, per the advisory description (before 3.10.4 is affected).

## Timeline

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

## Documents

- [advisory] Vendor advisory: github.com https://github.com/nltk/nltk/security/advisories/GHSA-8fx7-8jr8-84rv
- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/nltk-before-3.10.4-denial-of-service-via-steppingrecursivedescentparser-parse

## From the sources

NLTK before 3.10.4 contains an uncontrolled resource consumption vulnerability in SteppingRecursiveDescentParser.parse() that lacks any max_time deadline or step limit. Attackers influencing the grammar can supply an ambiguous self-embedding grammar and short token input to force unbounded top-down search, pinning CPU cores and exhausting worker pools.

---

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