NLTKのWordNet処理に再帰の深さ制限がなく、サービス停止のおそれがある脆弱性
Summary
NLTKのSynset.tree()とacyclic_tree()には、再帰処理に深さの上限がないため、攻撃者が細工したWordNet形式の語彙資源を読み込ませると、処理が止まるおそれがあります。影響を受けるのは3.10.4より前のNLTKで、修正版は3.10.4です。NLTKに付属するWordNet 3.0では上限を超えないと説明されており、外部の語彙資源を読み込む環境を優先して確認してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
NLTKのSynset.tree()とacyclic_tree()には、再帰処理に深さの上限がないため、攻撃者が細工したWordNet形式の語彙資源を読み込ませると、処理が止まるおそれがあります。影響を受けるのは3.10.4より前のNLTKで、修正版は3.10.4です。NLTKに付属するWordNet 3.0では上限を超えないと説明されており、外部の語彙資源を読み込む環境を優先して確認してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| nltknltk | — | Not listed |
| PyPInltk |
< 3.10.4→ 3.10.4 |
3.10.4 |
| pipnltk |
< 3.10.4→ 3.10.4 |
3.10.4 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Debian DEBIAN-CVE-2026-129223 nltk No fixed version in this record
- Ubuntu UBUNTU-CVE-2026-129223 nltk No fixed version in this record
Original description The description as published by the source.
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 a…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- package github.com
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com