All vulnerabilities

PyPI

CVE-2026-129230

NLTK: Uncontrolled recursion in WordNet Synset hypernym walkers (max_depth/min_depth/hypernym_paths/hypernym_distances) causes DoS

Severity
Medium 5.5
Published
19 Nov 2026
Last changed
20 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
3.10.4
Exploit chance
0.2% in the next 30 daysHigher than 14% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)Uncontrolled recursion (CWE-674)
Attack
Needs local access · No login needed · Needs someone to click or open something
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Also known as
GHSA-53pg-5qp8-mhvr
Sources
OSV.dev and GitHub

Description

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. 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.

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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
nltkPyPI · osv:PyPI:nltk
  • Every version before 3.10.4

About nltk

Weekly downloads (PyPI)
11,948,568PyPI Stats, 23 Nov 2026

References