{"vuln_id":"CVE-2026-129230","aliases":["GHSA-53pg-5qp8-mhvr"],"description":"nltk: nltk: Denial of Service via uncontrolled recursion in WordNet","published_at":"2026-11-19T17:27:04Z","modified_at":"2026-11-22T21:00:06.877859Z","first_seen_at":"2026-11-21T19:15:15.262584Z","severity":"medium","severity_source":"nvd","cvss_score":5.5,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","cwe":["CWE-835","CWE-400","CWE-674"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00237,"epss_percentile":0.1486,"nvd_status":"Awaiting Analysis","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-129230"},"matched_alias":null,"items":[{"id":10704,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-53pg-5qp8-mhvr: NLTK: Uncontrolled recursion in WordNet Synset hypernym walkers (max_depth/min_depth/hypernym_paths/hypernym_distances) causes DoS","summary":"NLTK: Uncontrolled recursion in WordNet Synset hypernym walkers (max_depth/min_depth/hypernym_paths/hypernym_distances) causes DoS\n\n## Summary\n\nFour 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.\n` 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.\n\n## Root Cause\n\n`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.\n\n```text\nAffected functions in nltk/corpus/reader/wordnet.py:\nSynset.max_depth (nltk/corpus/reader/wordnet.py:550)\nSynset.min_depth (nltk/corpus/reader/wordnet.py:564)\nSynset.hypernym_paths (nltk/corpus/reader/wordnet.py:666)\nSynset.hypernym_distances (nltk/corpus/reader/wordnet.py:768)\nUntrusted pointer stored at nltk/corpus/reader/wordnet.py:1694\nRe-entry edge: hypernyms() (:138) -> _related('@') (:1103) -> synset_from_pos_and_offset (:1104)\n```\n\n## Impact\n\nAn attacker who can supply a WordNet `data.\n` 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 availabil\n\nAffected: PyPI:nltk\n\nFixed in: 3.10.4\n\nReferences:\nhttps://github.com/nltk/nltk/security/advisories/GHSA-53pg-5qp8-mhvr\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-129230\nhttps://github.com/nltk/nltk/pull/3895\nhttps://github.com/nltk/nltk/commit/34adf1ee425b5c817d2a88c674bac68672e3ab26\nhttps://github.com/nltk/nltk\nhttps://github.com/nltk/nltk/releases/tag/v3.10.4","url":"https://osv.dev/vulnerability/GHSA-53pg-5qp8-mhvr","published_at":"2026-11-19T23:49:16Z","updated_at":"2026-11-20T00:00:04.071291Z","fetched_at":"2026-11-21T19:15:55.946117Z","severity":"medium","cvss_score":5.5,"epss":0.00237,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-129230","vuln_ids":["CVE-2026-129230","GHSA-53PG-5QP8-MHVR"],"tags":["osv","pypi","fix-available"],"cluster_id":2154,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10704","html":"https://vulnwatch.ve1ve2.com/item/10704"}},{"id":2363,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-53pg-5qp8-mhvr / CVE-2026-129230: NLTK: Uncontrolled recursion in WordNet Synset hypernym walkers (max_depth/min_depth/hypernym_paths/hypernym_distances) causes DoS","summary":"NLTK: Uncontrolled recursion in WordNet Synset hypernym walkers (max_depth/min_depth/hypernym_paths/hypernym_distances) causes DoS\n\n## Summary\n\nFour 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.\n` 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.\n\n## Root Cause\n\n`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.\n\n```text\nAffected functions in nltk/corpus/reader/wordnet.py:\nSynset.max_depth (nltk/corpus/reader/wordnet.py:550)\nSynset.min_depth (nltk/corpus/reader/wordnet.py:564)\nSynset.hypernym_paths (nltk/corpus/reader/wordnet.py:666)\nSynset.hypernym_distances (nltk/corpus/reader/wordnet.py:768)\nUntrusted pointer stored at nltk/corpus/reader/wordnet.py:1694\nRe-entry edge: hypernyms() (:138) -> _related('@') (:1103) -> synset_from_pos_and_offset (:1104)\n```\n\n## Impact\n\nAn attacker who can supply a WordNet `data.\n` 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 availabil\n\nAffected packages: pip:nltk\nPatched: nltk 3.10.4","url":"https://github.com/advisories/GHSA-53pg-5qp8-mhvr","published_at":"2026-11-19T23:49:16Z","updated_at":"2026-11-19T23:49:17Z","fetched_at":"2026-11-21T19:15:18.416780Z","severity":"medium","cvss_score":5.5,"epss":0.00237,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-129230","vuln_ids":["CVE-2026-129230","GHSA-53PG-5QP8-MHVR"],"tags":["ghsa","pip","CWE-400","CWE-674"],"cluster_id":2154,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2363","html":"https://vulnwatch.ve1ve2.com/item/2363"}},{"id":15164,"source":{"id":"osv","name":"OSV.dev"},"title":"DEBIAN-CVE-2026-129230: NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Proc…","summary":"NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. Prior to 3.10.4, WordNet Synset.max_depth, min_depth, hypernym_paths, and hypernym_distances recursively follow attacker-controlled corpus pointers without a visited-node set or depth cap. A cyclic or excessively deep hypernym graph can raise RecursionError and terminate traversal APIs and similarity operations that depend on them. This issue is fixed in version 3.10.4.\n\nAffected: Debian:12:nltk, Debian:13:nltk, Debian:14:nltk\n\nNo fixed version published yet\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2026-129230","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2026-129230","published_at":"2026-11-19T18:18:08.100000Z","updated_at":"2026-11-22T21:00:06.877859Z","fetched_at":"2026-11-23T03:05:53.019730Z","severity":"medium","cvss_score":5.5,"epss":0.00237,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"debian","product":"12:nltk","vuln_id":"CVE-2026-129230","vuln_ids":["CVE-2026-129230","DEBIAN-CVE-2026-129230","GHSA-53PG-5QP8-MHVR"],"tags":["osv","debian","no-fix-yet"],"cluster_id":842,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/15164","html":"https://vulnwatch.ve1ve2.com/item/15164"}},{"id":9041,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-129230: NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Proc…","summary":"NLTK (Natural Language Toolkit) is a suite of open source Python modules, data sets, and tutorials supporting research and development in Natural Language Processing. Prior to 3.10.4, WordNet Synset.max_depth, min_depth, hypernym_paths, and hypernym_distances recursively follow attacker-controlled corpus pointers without a visited-node set or depth cap. A cyclic or excessively deep hypernym graph can raise RecursionError and terminate traversal APIs and similarity operations that depend on them. This issue is fixed in version 3.10.4.\n\nReferences:\nhttps://github.com/nltk/nltk/commit/34adf1ee425b5c817d2a88c674bac68672e3ab26\nhttps://github.com/nltk/nltk/pull/3895\nhttps://github.com/nltk/nltk/releases/tag/v3.10.4\nhttps://github.com/nltk/nltk/security/advisories/GHSA-53pg-5qp8-mhvr\nhttps://github.com/nltk/nltk/security/advisories/GHSA-53pg-5qp8-mhvr","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129230","published_at":"2026-11-19T18:18:08.100000Z","updated_at":"2026-11-19T19:17:22.020000Z","fetched_at":"2026-11-21T19:15:31.484693Z","severity":"medium","cvss_score":5.5,"epss":0.00237,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-129230","vuln_ids":["CVE-2026-129230","GHSA-53PG-5QP8-MHVR"],"tags":["CWE-400","CWE-674"],"cluster_id":842,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/9041","html":"https://vulnwatch.ve1ve2.com/item/9041"}},{"id":1103,"source":{"id":"redhat","name":"Red Hat Security Data API"},"title":"CVE-2026-129230: nltk: nltk: Denial of Service via uncontrolled recursion in WordNet","summary":"nltk: nltk: Denial of Service via uncontrolled recursion in WordNet","url":"https://access.redhat.com/security/cve/cve-2026-129230","published_at":"2026-11-19T17:27:04Z","updated_at":null,"fetched_at":"2026-11-21T19:15:08.893771Z","severity":"medium","cvss_score":5.5,"epss":0.00237,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"redhat","product":null,"vuln_id":"CVE-2026-129230","vuln_ids":["CVE-2026-129230","GHSA-53PG-5QP8-MHVR"],"tags":["redhat"],"cluster_id":842,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/1103","html":"https://vulnwatch.ve1ve2.com/item/1103"}}]}