CVE-2026-129223
### Summary The recursive traversal engines behind WordNetCorpusReader's Synset.tree() and Synset.acyclic_tree() have no maximum call-depth safeguard and default to unlimited depth. They guard against literal cycles, but not against a long, genuinely acyclic relation chain — which exhausts the Python call stack the same way as the sibling DependencyGraph finding I reported separately. Real-world exploitability requires the host application to load a custom/foreign WordNet-format lexical resource rather than NLTK's bundled default corpus — flagging that narrower scope honestly up front since it affects severity, not validity. ### Details `nltk/util.py`'s `acyclic_depth_first()` (~lines 471-541) and `acyclic_branches_depth_first()` (~lines 544-625) recurse once per graph edge, default to `depth=-1` ("unlimited"), and guard against re-visiting the same node via an explicit `traversed` set (hence "acyclic") — but that set only prevents literal cycles, it never bounds how many *distinct* nodes a single call chain may pass through before returning. `Synset.tree(rel, depth=-1)` (`nltk/corpus/reader/wordnet.py`, ~line 664) calls the recursive `acyclic_branches_depth_first`. There is also a third, easy-to-miss method: `Synset.acyclic_tree()`, a vestigial class-attribute alias for `acyclic_depth_first` — also genuinely recursive and vulnerable. **Important correction to an earlier draft of this finding:** `Synset.closure(rel, depth=-1)` (~line 609) does **not** share this bug — it actually calls `acyclic_breadth_first()`, a completely different, iterative queue/deque-based function with no recursion at all. I verified this directly: feeding both `acyclic_breadth_first` and the real `Synset.closure()` a 20,000-node genuinely-acyclic chain produces zero crash, while `acyclic_depth_first`/`acyclic_branches_depth_first`/`Synset.tree()`/`Synset.acyclic_tree()` crash reliably at ~1000-1500 nodes on the identical data. Only `.tree()` and `.acyclic_tree()` are affected — not `.clo
Properties
- Summary
- Natural Language Toolkit (NLTK): Uncontrolled recursion (crash DoS) in Synset.tree()/acyclic_tree() via WordNet relation traversal
- Severity
- high
- Nvd fetched at
- 2026-11-22T12:30:49.958423+00:00
- Epss score
- 0.0051
- Cvss score
- 7.5
- Cvss severity
- HIGH
- Retrieved at
- 2026-11-22T12:32:26+00:00
- Ghsa published
- 2026-11-19T23:53:18Z
- Source url
- https://github.com/advisories/GHSA-8846-p9w9-5frf
- Ghsa updated
- 2026-11-19T23:53:19Z
- Ghsa id
- GHSA-8846-p9w9-5frf
- Last source
- FIRST EPSS
- Score
- 7.5
- Cvss version
- 3.1
- Cve id
- CVE-2026-129223
- Cvss vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- First seen by Signal
- 2026-11-19T19:29:21+00:00
- Name
- CVE-2026-129223
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph