MEDIUMCVSS v3.1 5.3Vulnerability

CVE-2026-129228

## Root Cause The Toolbox settings-tree helpers recurse over the parsed element tree without any depth bound. `_to_settings_string` (`nltk/toolbox.py:418`), `remove_blanks` (`nltk/toolbox.py:432`), `add_default_fields` (`nltk/toolbox.py:451`), `_sort_fields` (`nltk/toolbox.py:484`), and `add_blank_lines` (`nltk/toolbox.py:502,516`) each recurse once per element level with no depth counter or explicit stack. The producer `ToolboxSettings.parse` builds the element tree iteratively, so nesting depth is driven entirely by attacker-supplied `\+marker` / `\-marker` pairs. ## Impact An application that parses an untrusted Toolbox settings file and then serialises or transforms it through any of the public helper functions aborts with an unhandled `RecursionError`, terminating the affected operation or request worker (denial of service, CWE-674). The recursion is pure Python, yielding a catchable `RecursionError` rather than memory corruption or code execution. Confidentiality and integrity are unaffected. ## Attack Chain 1. The application parses an untrusted settings file via `ToolboxSettings.open_string` / `open` plus `parse`, producing an *N*-deep element tree; parsing is iterative and completes without error. 2. The application passes the tree to a public helper — `to_settings_string`, `remove_blanks`, `add_default_fields`, `sort_fields`, or `add_blank_lines` — as in the module's own parse-then-serialise round trip. 3. The helper recurses once per element level with no depth guard, consuming call-stack frames. This holds even when the helper's configuration dictionaries are empty. 4. Once the nesting depth exceeds the interpreter recursion limit, an unhandled `RecursionError` propagates out of the public API. ## Bypass Evidence Against the shipped source at the default recursion limit, a settings input nested 5 levels deep traverses cleanly through every helper, while a well-formed input nested 5000 levels deep drives each of the five helpers to an

Properties

Severity
medium
Summary
NLTK: Uncontrolled recursion in Toolbox settings helpers causes denial of service via deeply nested input
Nvd fetched at
2026-11-22T12:30:49.958423+00:00
Epss score
0.00469
Cvss severity
MEDIUM
Cvss score
5.3
Retrieved at
2026-11-22T12:32:26+00:00
Ghsa published
2026-11-19T23:50:37Z
Source url
https://github.com/advisories/GHSA-f2h2-f4fc-p978
Ghsa updated
2026-11-19T23:50:38Z
Ghsa id
GHSA-f2h2-f4fc-p978
Last source
FIRST EPSS
Score
5.3
Cvss version
3.1
Cve id
CVE-2026-129228
Cvss vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
First seen by Signal
2026-11-19T19:29:21+00:00
Name
CVE-2026-129228
Is ghsa only
false
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Related Entities (3)

AFFECTS (1)

→[Software]pip/nltk

HAS_WEAKNESS (1)

VULNERABLE_TO (1)

←[Software]pip/nltk

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-129228 (CVSS v3.1 5.3) — Ninja Signal Threat Intelligence | Ninja Signal