Skip to main content
CVE-2026-129230VulnerabilityPublished

WordNet Synset hypernym walkers · NLTK: Uncontrolled recursion

Affects gptlineSource GCVE Database

0
Compare
Authoritative record:CVE-2026-129230· Medium 5.5

Not known to be exploited · CVSS 5.5 Medium : upgrade to 1.0.8_25 when convenient.

Data as of 24 Nov 2026, 21:27 UTC

CVSS 3.1 base score
5.5Medium
How severe the flaw is on the 0–10 CVSS scale.

Thin evidence

One scorer or none
CVSS scores by source
CNA (GitHub_M)CVSS 3.15.5
Patch
Available – fixed in 1.0.8_25
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 19 Nov 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 24 Nov 2026.

What to do

Upgrade gptline to 1.0.8_25.

Affected software

ProductAffectedFixed in
Homebrewgptlinepkg:brew/gptlineOther threatsAffected
  • >=1.0.8 <1.0.8_25
Fixed in
  • 1.0.8_25

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

Description

## 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.py:550) Synset.min_depth (nltk/corpus/reader/wordnet.py:564) Synset.hypernym_paths (nltk/corpus/reader/wordnet.py:666) Synset.hypernym_distances (nltk/corpus/reader/wordnet.py:768) Untrusted pointer stored at nltk/corpus/reader/wordnet.py:1694 Re-entry edge: hypernyms() (:138) -> _related('@') (:1103) -> synset_from_pos_and_offset (:1104) ``` ## Impact An attacker who can supply a WordNet `data.<pos>` corpus file that the victim loads (for example a downloaded, mirrored, or user-provided WordNet corpus) can construct a hypernym pointer graph that is cyclic or deeper than the recursion limit. When the application then calls any hypernym-depth or path method, the walker recurses without bound and raises an uncaught `RecursionError`, terminating the current traversal and any request or worker process that does not handle it. Under a raised or removed recursion limit, unbounded recursion can instead exhaust the native stack and abort the process. The impact is availability only; there is no confidentiality or integrity effect. Reachable public entry points include `hypernym_paths` and `hypernym_distances` directly, and `max_depth`/`min_depth` indirectly through `lowest_common_hypernyms`, `wup_similarity`, `path_similarity`, and `lch_similarity`. ## Proof of Concept `Requires only the nltk package under test on PYTHONPATH; no network or WordNet data download. The reader is instantiated with __new__ to skip unrelated OMW/lexname loading, the same technique NLTK's own recursion-DoS hardening test uses; the parser and the walker under test are unmodified library code.` 1. Build a `WordNetCorpusReader` without its unrelated data-loading side effects. 2. Parse two synset records whose `@` (hypernym) pointers reference each other, forming a 2-cycle. 3. Call `Synset.max_depth()` on one of them. ```python import sys sys.setrecursionlimit(1500) from nltk.corpus.reader.wordnet import WordNetCorpusReader reader = WordNetCorpusReader.__new__(WordNetCorpusReader) reader._synset_offset_cache = {"n": {}} reader._lexnames = ["adj.all"] reader._lemma_pos_offset_map = {"w88": {"n": [88]}, "w99": {"n": [99]}} def make(offset, partner): line = f"{offset:08d} 00 n 01 w{offset} 0 001 @ {partner:08d} n 0000 | gloss" s = reader._synset_from_pos_and_line("n", line) reader._synset_offset_cache["n"][offset] = s return s a = make(88, 99) b = make(99, 88) print("hypernym pointers:", dict(a._pointers)) print("hypernyms():", a.hypernyms()) try: a.max_depth() print("returned normally") except RecursionError: print("VULNERABLE: max_depth() recursed without bound -> RecursionError") ``` ```text hypernym pointers: {'@': {('n', 99)}} hypernyms(): [Synset('w99.n.01')] VULNERABLE: max_depth() recursed without bound -> RecursionError ``` ## Attack Chain 1. **Exposure:** The victim application loads a WordNet `data.<pos>` corpus file whose content is attacker-supplied. Corpus file content is untrusted input in NLTK, consistent with t

References

Community reviews

Loading reviews…