{"vuln_id":"CVE-2026-129225","aliases":["GHSA-xfcv-m889-fmqg"],"description":"nltk: nltk: Denial of Service via crafted dependency graphs","published_at":"2026-11-19T17:21:53Z","modified_at":"2026-11-22T21:00:06.664676Z","first_seen_at":"2026-11-21T19:15:15.262592Z","severity":"medium","severity_source":"nvd","cvss_score":5.3,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","cwe":["CWE-835","CWE-674"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00479,"epss_percentile":0.42214,"nvd_status":"Awaiting Analysis","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-129225"},"matched_alias":null,"items":[{"id":10700,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-xfcv-m889-fmqg: NLTK: Uncontrolled recursion in DependencyGraph traversal causes denial of service via deep dependency chains","summary":"NLTK: Uncontrolled recursion in DependencyGraph traversal causes denial of service via deep dependency chains\n\n## Root Cause\nThe dependency-graph traversal helpers recurse over dependency links without any depth\nbound or visited set. `DependencyGraph._tree` (`nltk/parse/dependencygraph.py:404`)\nrecurses once per dependency link, `triples` (`nltk/parse/dependencygraph.py:432`) is a\nrecursive generator, and `get_cycle_path` (`nltk/parse/dependencygraph.py:520`) recurses\nover dependencies. The neighbouring `contains_cycle` method was deliberately rewritten as\nan iterative depth-first search, but these sibling helpers on the public traversal path\nwere left recursive with no depth counter.\n\n## Impact\nAn application that parses an untrusted CoNLL/Malt-TAB dependency structure and then walks\nit via `tree()` or `triples()` aborts with an unhandled `RecursionError`, terminating the\naffected operation or request worker (denial of service, CWE-674). The recursion is pure\nPython, so the result is a catchable `RecursionError`, not memory corruption or code\nexecution. Confidentiality and integrity are unaffected. `get_cycle_path` additionally\nlacks a visited set and will not terminate on a genuine cycle.\n\n## Attack Chain\n1. The application constructs `DependencyGraph(conll_str)` from attacker-supplied text\n   where token *k*'s head is token *k+1*, forming a linear dependency chain of length *N*.\n   Graph construction (`_parse`) is iterative and completes without error.\n2. The application calls the public `DependencyGraph.tree()`\n   (`nltk/parse/dependencygraph.py:408`), which invokes `_tree(root)`.\n3. `_tree` recurses once per chain link with no depth guard and no visited set, consuming\n   one stack frame per link (the list comprehension costs roughly two frames per level).\n4. Once the chain length exceeds the interpreter recursion limit, an unhandled\n   `RecursionError` propagates out of the public API. `triples()` fails the same way.\n\n## Bypass Evidence\nAgainst the shipped source at the default recursion limit, a chain of length 5 walks\ncleanly through `tree()`, while a chain of length 5000 raises an unhandled\n`RecursionError`; `triples()` fails identically. The minimal trigger is roughly *N*=500\ntokens at the default recursion limit — a modest, realistic parse. Because the graph\nbuilds iteratively in both cases, the fault is isolated to the recursive traversal rather\nthan to parsing. A repository-wide search confirms no depth guard exists in this file; the\niterative rewrite was applied only to `contains_cycle`.\n\n## Suggested Fix\nConvert `_tree`, `triples`, and `get_cycle_path` to iterative traversals, or add a\nrecursion-depth bound (and, for `get_cycle_path`, a visited set) analogous to the\niterative rewrite already applied to `contains_cycle`.\n\nReported by pi (GitHub: @manus-pi).\n\n## Fix status (2026-09-28)\n\nStatus: MERGED on develop (unreleased; v3.10.3 of 2026-08-12 predates the fix).\n\nPR: #3885 \"Bound recursion depth in parsers and traversal helpers\" (ekaf), merged 2026-09-11, merge commit e521ecafc on develop.\n\nFix commit: a74682757 (nltk/parse/dependencygraph.\n\nAffected: PyPI:nltk\n\nFixed in: 3.10.4\n\nReferences:\nhttps://github.com/nltk/nltk/security/advisories/GHSA-xfcv-m889-fmqg\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-129225\nhttps://github.com/nltk/nltk/pull/3885\nhttps://github.com/nltk/nltk/commit/a74682757cee8c11128ad277d2f2bd0b8e1884ff\nhttps://github.com/nltk/nltk\nhttps://github.com/nltk/nltk/releases/tag/v3.10.4","url":"https://osv.dev/vulnerability/GHSA-xfcv-m889-fmqg","published_at":"2026-11-19T23:52:20Z","updated_at":"2026-11-20T00:00:04.079126Z","fetched_at":"2026-11-21T19:15:55.946114Z","severity":"medium","cvss_score":5.3,"epss":0.00479,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-129225","vuln_ids":["CVE-2026-129225","GHSA-XFCV-M889-FMQG"],"tags":["osv","pypi","fix-available"],"cluster_id":2146,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10700","html":"https://vulnwatch.ve1ve2.com/item/10700"}},{"id":2358,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-xfcv-m889-fmqg / CVE-2026-129225: NLTK: Uncontrolled recursion in DependencyGraph traversal causes denial of service via deep dependency chains","summary":"NLTK: Uncontrolled recursion in DependencyGraph traversal causes denial of service via deep dependency chains\n\n## Root Cause\nThe dependency-graph traversal helpers recurse over dependency links without any depth\nbound or visited set. `DependencyGraph._tree` (`nltk/parse/dependencygraph.py:404`)\nrecurses once per dependency link, `triples` (`nltk/parse/dependencygraph.py:432`) is a\nrecursive generator, and `get_cycle_path` (`nltk/parse/dependencygraph.py:520`) recurses\nover dependencies. The neighbouring `contains_cycle` method was deliberately rewritten as\nan iterative depth-first search, but these sibling helpers on the public traversal path\nwere left recursive with no depth counter.\n\n## Impact\nAn application that parses an untrusted CoNLL/Malt-TAB dependency structure and then walks\nit via `tree()` or `triples()` aborts with an unhandled `RecursionError`, terminating the\naffected operation or request worker (denial of service, CWE-674). The recursion is pure\nPython, so the result is a catchable `RecursionError`, not memory corruption or code\nexecution. Confidentiality and integrity are unaffected. `get_cycle_path` additionally\nlacks a visited set and will not terminate on a genuine cycle.\n\n## Attack Chain\n1. The application constructs `DependencyGraph(conll_str)` from attacker-supplied text\n   where token *k*'s head is token *k+1*, forming a linear dependency chain of length *N*.\n   Graph construction (`_parse`) is iterative and completes without error.\n2. The application calls the public `DependencyGraph.tree()`\n   (`nltk/parse/dependencygraph.py:408`), which invokes `_tree(root)`.\n3. `_tree` recurses once per chain link with no depth guard and no visited set, consuming\n   one stack frame per link (the list comprehension costs roughly two frames per level).\n4. Once the chain length exceeds the interpreter recursion limit, an unhandled\n   `RecursionError` propagates out of the public API. `triples()` fails the same way.\n\n## Bypass Evidence\nAgainst the shipped source at the default recursion limit, a chain of length 5 walks\ncleanly through `tree()`, while a chain of length 5000 raises an unhandled\n`RecursionError`; `triples()` fails identically. The minimal trigger is roughly *N*=500\ntokens at the default recursion limit — a modest, realistic parse. Because the graph\nbuilds iteratively in both cases, the fault is isolated to the recursive traversal rather\nthan to parsing. A repository-wide search confirms no depth guard exists in this file; the\niterative rewrite was applied only to `contains_cycle`.\n\n## Suggested Fix\nConvert `_tree`, `triples`, and `get_cycle_path` to iterative traversals, or add a\nrecursion-depth bound (and, for `get_cycle_path`, a visited set) analogous to the\niterative rewrite already applied to `contains_cycle`.\n\nReported by pi (GitHub: @manus-pi).\n\n## Fix status (2026-09-28)\n\nStatus: MERGED on develop (unreleased; v3.10.3 of 2026-08-12 predates the fix).\n\nPR: #3885 \"Bound recursion depth in parsers and traversal helpers\" (ekaf), merged 2026-09-11, merge commit e521ecafc on develop.\n\nFix commit: a74682757 (nltk/parse/dependencygraph.\n\nAffected packages: pip:nltk\nPatched: nltk 3.10.4","url":"https://github.com/advisories/GHSA-xfcv-m889-fmqg","published_at":"2026-11-19T23:52:20Z","updated_at":"2026-11-19T23:52:22Z","fetched_at":"2026-11-21T19:15:18.416776Z","severity":"medium","cvss_score":5.3,"epss":0.00479,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-129225","vuln_ids":["CVE-2026-129225","GHSA-XFCV-M889-FMQG"],"tags":["ghsa","pip","CWE-674"],"cluster_id":2146,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2358","html":"https://vulnwatch.ve1ve2.com/item/2358"}},{"id":15171,"source":{"id":"osv","name":"OSV.dev"},"title":"DEBIAN-CVE-2026-129225: 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. In 3.10.3 and earlier, DependencyGraph._tree and triples recurse once per dependency edge without a depth bound, and get_cycle_path also lacks a visited-set termination guard. A deeply chained or cyclic attacker-controlled CoNLL or Malt-TAB dependency structure can raise RecursionError and abort a parse worker. 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-129225","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2026-129225","published_at":"2026-11-19T18:18:07.470000Z","updated_at":"2026-11-22T21:00:06.664676Z","fetched_at":"2026-11-23T03:05:53.019736Z","severity":"medium","cvss_score":5.3,"epss":0.00479,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"debian","product":"12:nltk","vuln_id":"CVE-2026-129225","vuln_ids":["CVE-2026-129225","DEBIAN-CVE-2026-129225","GHSA-XFCV-M889-FMQG"],"tags":["osv","debian","no-fix-yet"],"cluster_id":844,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/15171","html":"https://vulnwatch.ve1ve2.com/item/15171"}},{"id":9037,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-129225: 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. In 3.10.3 and earlier, DependencyGraph._tree and triples recurse once per dependency edge without a depth bound, and get_cycle_path also lacks a visited-set termination guard. A deeply chained or cyclic attacker-controlled CoNLL or Malt-TAB dependency structure can raise RecursionError and abort a parse worker. This issue is fixed in version 3.10.4.\n\nReferences:\nhttps://github.com/nltk/nltk/commit/a74682757cee8c11128ad277d2f2bd0b8e1884ff\nhttps://github.com/nltk/nltk/pull/3885\nhttps://github.com/nltk/nltk/releases/tag/v3.10.4\nhttps://github.com/nltk/nltk/security/advisories/GHSA-xfcv-m889-fmqg\nhttps://github.com/nltk/nltk/security/advisories/GHSA-xfcv-m889-fmqg","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129225","published_at":"2026-11-19T18:18:07.470000Z","updated_at":"2026-11-19T19:17:21.627000Z","fetched_at":"2026-11-21T19:15:31.484690Z","severity":"medium","cvss_score":5.3,"epss":0.00479,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-129225","vuln_ids":["CVE-2026-129225","GHSA-XFCV-M889-FMQG"],"tags":["CWE-674"],"cluster_id":844,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/9037","html":"https://vulnwatch.ve1ve2.com/item/9037"}},{"id":1105,"source":{"id":"redhat","name":"Red Hat Security Data API"},"title":"CVE-2026-129225: nltk: nltk: Denial of Service via crafted dependency graphs","summary":"nltk: nltk: Denial of Service via crafted dependency graphs","url":"https://access.redhat.com/security/cve/cve-2026-129225","published_at":"2026-11-19T17:21:53Z","updated_at":null,"fetched_at":"2026-11-21T19:15:08.893779Z","severity":"medium","cvss_score":5.3,"epss":0.00479,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"redhat","product":null,"vuln_id":"CVE-2026-129225","vuln_ids":["CVE-2026-129225","GHSA-XFCV-M889-FMQG"],"tags":["redhat"],"cluster_id":844,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/1105","html":"https://vulnwatch.ve1ve2.com/item/1105"}}]}