{"vuln_id":"GHSA-8fx7-8jr8-84rv","aliases":["CVE-2026-126303"],"description":"NLTK: Unbounded CPU consumption in SteppingRecursiveDescentParser.parse() with ambiguous or self-embedding grammars","published_at":"2026-11-13T21:02:19Z","modified_at":"2026-11-18T00:45:13.871328Z","first_seen_at":"2026-11-21T19:15:20.154969Z","severity":"high","severity_source":"ghsa","cvss_score":7.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","cwe":["CWE-400","CWE-407"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-8fx7-8jr8-84rv"},"matched_alias":null,"items":[{"id":10783,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-8fx7-8jr8-84rv: NLTK: Unbounded CPU consumption in SteppingRecursiveDescentParser.parse() with ambiguous or self-embedding grammars","summary":"NLTK: Unbounded CPU consumption in SteppingRecursiveDescentParser.parse() with ambiguous or self-embedding grammars\n\n## Summary\n\n`nltk.parse.recursivedescent.SteppingRecursiveDescentParser.parse()` performs an unbounded top-down search over ambiguous or self-embedding context-free grammars with no wall-clock or step limit. An actor who can influence the grammar and supply a short input to a caller that uses this parser can force a single `parse()` call to pin a CPU core indefinitely, producing a denial of service. The related base class `RecursiveDescentParser` gained a `max_time` wall-clock deadline, but the stepping subclass drives its own step loop and never arms or consults that deadline, and its constructor does not accept a `max_time` parameter, so the guard cannot be enabled on this path.\n\n## Root Cause\n\n`RecursiveDescentParser` bounds its recursive search inside `_parse`: it arms a wall-clock deadline on the first step and raises `TimeoutError` once `max_time` (default 5.0 seconds) is exceeded. `SteppingRecursiveDescentParser` was designed for interactive single-stepping and overrides both `parse()` and `_parse`. Its `parse()` runs `initialize()` followed by a `while self.step() is not None` loop that never enters the guarded base `_parse`. Its `_parse` override is a state-capturing stub that records history and returns a sentinel, and it never references the inherited `self._parse_deadline` or `self._max_time`. Its `__init__` signature omits `max_time` entirely, so a caller cannot enable or tighten a bound. The security invariant that a single parse must terminate within a bounded time is therefore never enforced on this parser.\n\n```text\nAffected component: nltk.parse.recursivedescent.SteppingRecursiveDescentParser\n- parse()      nltk/parse/recursivedescent.py:428-433  (drives its own step loop, no bound armed or checked)\n- _parse()     nltk/parse/recursivedescent.py:643-668  (stub override; never consults self._parse_deadline / self._max_time)\n- __init__()   nltk/parse/recursivedescent.py:410-418  (signature (self, grammar, trace=0); no max_time parameter)\nBase guard for comparison: RecursiveDescentParser._parse nltk/parse/recursivedescent.py:141-150\n```\n\n## Impact\n\nAn actor who controls or influences the grammar passed to `SteppingRecursiveDescentParser` and can supply a short token sequence to a caller that invokes `parse()` can cause that call to never return. The top-down search enumerates a derivation space that grows on the order of the Catalan numbers with no memoization of the search and no deadline, so one crafted grammar plus a short input deterministically consumes a CPU core. In a deployment that parses attacker-influenced input on a bounded worker pool, repeated requests exhaust the pool and deny service to legitimate users. No authentication, privilege, or user interaction is required in that worst-credible deployment. Exploitation requires that the target actually use this parser on untrusted input; because the stepping parser is primarily a debugging or interactive-stepping component that backs a GUI, real-world exposure is narrower th\n\nAffected: PyPI:nltk\n\nFixed in: 3.10.4\n\nReferences:\nhttps://github.com/nltk/nltk/security/advisories/GHSA-8fx7-8jr8-84rv\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-126303\nhttps://github.com/nltk/nltk/pull/3895\nhttps://github.com/nltk/nltk/commit/e20c40e26ec9306de885703f6e53250695f1f49b\nhttps://github.com/nltk/nltk\nhttps://github.com/nltk/nltk/releases/tag/v3.10.4\nhttps://www.vulncheck.com/advisories/nltk-before-3.10.4-denial-of-service-via-steppingrecursivedescentparser-parse","url":"https://osv.dev/vulnerability/GHSA-8fx7-8jr8-84rv","published_at":"2026-11-13T21:02:19Z","updated_at":"2026-11-18T00:45:13.871328Z","fetched_at":"2026-11-21T19:15:55.946173Z","severity":"high","cvss_score":7.5,"epss":0.00558,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-126303","vuln_ids":["CVE-2026-126303","GHSA-8FX7-8JR8-84RV"],"tags":["osv","pypi","fix-available"],"cluster_id":2321,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10783","html":"https://vulnwatch.ve1ve2.com/item/10783"}},{"id":2444,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-8fx7-8jr8-84rv / CVE-2026-126303: NLTK: Unbounded CPU consumption in SteppingRecursiveDescentParser.parse() with ambiguous or self-embedding grammars","summary":"NLTK: Unbounded CPU consumption in SteppingRecursiveDescentParser.parse() with ambiguous or self-embedding grammars\n\n## Summary\n\n`nltk.parse.recursivedescent.SteppingRecursiveDescentParser.parse()` performs an unbounded top-down search over ambiguous or self-embedding context-free grammars with no wall-clock or step limit. An actor who can influence the grammar and supply a short input to a caller that uses this parser can force a single `parse()` call to pin a CPU core indefinitely, producing a denial of service. The related base class `RecursiveDescentParser` gained a `max_time` wall-clock deadline, but the stepping subclass drives its own step loop and never arms or consults that deadline, and its constructor does not accept a `max_time` parameter, so the guard cannot be enabled on this path.\n\n## Root Cause\n\n`RecursiveDescentParser` bounds its recursive search inside `_parse`: it arms a wall-clock deadline on the first step and raises `TimeoutError` once `max_time` (default 5.0 seconds) is exceeded. `SteppingRecursiveDescentParser` was designed for interactive single-stepping and overrides both `parse()` and `_parse`. Its `parse()` runs `initialize()` followed by a `while self.step() is not None` loop that never enters the guarded base `_parse`. Its `_parse` override is a state-capturing stub that records history and returns a sentinel, and it never references the inherited `self._parse_deadline` or `self._max_time`. Its `__init__` signature omits `max_time` entirely, so a caller cannot enable or tighten a bound. The security invariant that a single parse must terminate within a bounded time is therefore never enforced on this parser.\n\n```text\nAffected component: nltk.parse.recursivedescent.SteppingRecursiveDescentParser\n- parse()      nltk/parse/recursivedescent.py:428-433  (drives its own step loop, no bound armed or checked)\n- _parse()     nltk/parse/recursivedescent.py:643-668  (stub override; never consults self._parse_deadline / self._max_time)\n- __init__()   nltk/parse/recursivedescent.py:410-418  (signature (self, grammar, trace=0); no max_time parameter)\nBase guard for comparison: RecursiveDescentParser._parse nltk/parse/recursivedescent.py:141-150\n```\n\n## Impact\n\nAn actor who controls or influences the grammar passed to `SteppingRecursiveDescentParser` and can supply a short token sequence to a caller that invokes `parse()` can cause that call to never return. The top-down search enumerates a derivation space that grows on the order of the Catalan numbers with no memoization of the search and no deadline, so one crafted grammar plus a short input deterministically consumes a CPU core. In a deployment that parses attacker-influenced input on a bounded worker pool, repeated requests exhaust the pool and deny service to legitimate users. No authentication, privilege, or user interaction is required in that worst-credible deployment. Exploitation requires that the target actually use this parser on untrusted input; because the stepping parser is primarily a debugging or interactive-stepping component that backs a GUI, real-world exposure is narrower th\n\nAffected packages: pip:nltk\nPatched: nltk 3.10.4","url":"https://github.com/advisories/GHSA-8fx7-8jr8-84rv","published_at":"2026-11-13T21:02:19Z","updated_at":"2026-11-18T00:26:23Z","fetched_at":"2026-11-21T19:15:18.416841Z","severity":"high","cvss_score":7.5,"epss":0.00558,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-126303","vuln_ids":["CVE-2026-126303","GHSA-8FX7-8JR8-84RV"],"tags":["ghsa","pip","CWE-400","CWE-407"],"cluster_id":2321,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2444","html":"https://vulnwatch.ve1ve2.com/item/2444"}}]}