MEDIUMCVSS v3.1 5.5Vulnerability

CVE-2026-129230

## Summary Four hypernym-walking methods on the WordNet `Synset` class in `nltk/corpus/reader/wordnet.py` (`max_depth`, `min_depth`, `hypernym_paths`, and `hypernym_distances`) traverse the hypernym pointer graph by direct recursion with no visited-node set and no depth cap. WordNet `data.<pos>` file content is untrusted corpus input in NLTK, the same trust boundary the project already treats as attacker-controlled across its corpus-content hardening work. When the parsed hypernym graph contains a cycle, or a chain deeper than the interpreter recursion limit, these methods recurse without bound and raise an uncaught `RecursionError`, aborting the traversal and any worker that does not catch it. No special privileges are needed; the victim only has to load an attacker-supplied corpus and call any of several shipped public methods that reach these walkers. ## Root Cause `Synset.max_depth` computes `1 + max(h.max_depth() for h in hypernyms)` and only assigns its `_max_depth` memo after that recursive expression fully returns. Because Python evaluates the right-hand side completely before binding the left-hand side, the memo is never set on a node that is still on the recursion stack, so a cyclic graph re-enters the same not-yet-memoized node indefinitely. `min_depth`, `hypernym_paths`, and `hypernym_distances` follow the same recursive descent with no cycle detection. The security invariant that graph traversal over untrusted corpus data must terminate is violated: the pointer offsets parsed from the data file are stored verbatim with no graph-shape validation, so the attacker controls the graph topology. The sibling walkers in the same class (`closure`, `tree`, `_shortest_hypernym_paths`) were hardened with acyclic/visited guards, which shows cyclic hypernym graphs are an in-scope threat that these four methods simply were not converted to handle. ```text Affected functions in nltk/corpus/reader/wordnet.py: Synset.max_depth (nltk/corpus/reader/wordnet.p

Properties

Summary
NLTK: Uncontrolled recursion in WordNet Synset hypernym walkers (max_depth/min_depth/hypernym_paths/hypernym_distances) causes DoS
Severity
medium
Nvd fetched at
2026-11-22T12:30:49.958423+00:00
Epss score
0.00237
Cvss score
5.5
Cvss severity
MEDIUM
Retrieved at
2026-11-22T12:32:26+00:00
Ghsa published
2026-11-19T23:49:16Z
Source url
https://github.com/advisories/GHSA-53pg-5qp8-mhvr
Ghsa updated
2026-11-19T23:49:17Z
Ghsa id
GHSA-53pg-5qp8-mhvr
Last source
FIRST EPSS
Score
5.5
Cvss version
3.1
Cve id
CVE-2026-129230
Cvss vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
First seen by Signal
2026-11-19T19:29:21+00:00
Name
CVE-2026-129230
Is ghsa only
false
Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Related Entities (4)

HAS_WEAKNESS (2)

AFFECTS (1)

→[Software]pip/nltk

VULNERABLE_TO (1)

←[Software]pip/nltk

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-129230 (CVSS v3.1 5.5) — Ninja Signal Threat Intelligence | Ninja Signal