{"vuln_id":"GHSA-59f9-gqg8-mqpj","aliases":["CVE-2026-126296","CVE-2026-15367"],"description":"NLTK: Path Traversal in save_maxent_params / load_maxent_params Allow Arbitrary File READ/WRITE","published_at":"2026-11-16T14:46:25Z","modified_at":"2026-11-16T14:46:26Z","first_seen_at":"2026-11-21T19:15:20.340382Z","severity":"medium","severity_source":"ghsa","cvss_score":6.3,"cvss_vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N","cwe":["CWE-22"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-59f9-gqg8-mqpj"},"matched_alias":null,"items":[{"id":2611,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-59f9-gqg8-mqpj / CVE-2026-126296: NLTK: Path Traversal in save_maxent_params / load_maxent_params Allow Arbitrary File READ/WRITE","summary":"NLTK: Path Traversal in save_maxent_params / load_maxent_params Allow Arbitrary File READ/WRITE\n\n### Summary\nPath traversal in NLTK's save_maxent_params() and load_maxent_params() allows arbitrary file write and arbitrary file read outside the directories permitted by NLTK's pathsec security mechanism.\n\nThis vulnerability was previously reported through Huntr, accepted by the NLTK project, and assigned CVE-2026-15367. A $750 bounty was paid through Huntr (i didnt get the fix bounty). Huntr subsequently shut down its OSS vulnerability program, so I am submitting this report through GitHub to continue the existing disclosure process and preserve the original CVE assignment and researcher credit.\n\n### Details\nThe affected functions are:\n\n- nltk.classify.maxent.load_maxent_params()\n- nltk.classify.maxent.save_maxent_params()\n\nBoth functions construct filesystem paths from the caller-controlled tab_dir argument and access them using Python's built-in open() without passing the paths through NLTK's pathsec validation.\n\nFor example, load_maxent_params() constructs and opens:\n\n-\n/weights.txt\n-\n/mapping.tab\n-\n/labels.txt\n-\n/alwayson.tab\n\nSimilarly, save_maxent_params() creates/writes files under the supplied tab_dir.\n\nThis bypasses the security boundary provided by nltk.pathsec. NLTK documents pathsec as the mechanism for restricting filesystem access to permitted roots, with strict enforcement intended to prevent unauthorized filesystem access.\n\nThe relevant implementation is in:\n\nnltk/classify/maxent.py\n\nThe affected functions can be found in the model parameter loading/saving section of that file.\n\nThis issue was previously disclosed through Huntr and accepted before the Huntr OSS program was shut down. The original Huntr report was assigned CVE-2026-15367 and received a $750 bounty.\n\nI am therefore submitting this GitHub Security Advisory primarily as a continuation/transfer of the existing disclosure rather than as a new vulnerability report.\n\n### PoC\nThe issue can be reproduced by enabling NLTK's path security enforcement and supplying a tab_dir outside the permitted root.\n\nFor example, with a controlled test environment:\n\n```py\nimport os\nimport tempfile\nimport nltk.pathsec as pathsec\nfrom nltk.classify.maxent import load_maxent_params, save_maxent_params\n\npathsec.ENFORCE = True\n\nallowed_dir = tempfile.mkdtemp()\noutside_dir = tempfile.mkdtemp()\n\n# The same outside-root path is rejected when accessed through pathsec.\ntry:\nwith pathsec.open(os.path.join(outside_dir, \"test.txt\"), \"w\") as f:\nf.write(\"test\")\nexcept Exception as e:\nprint(\"pathsec.open rejected outside-root access:\", type(e).__name__)\n\n# The vulnerable model-parameter APIs directly use open()\n# on paths derived from tab_dir.\n#\n# Supplying outside_dir as tab_dir causes the functions to access\n# files under outside_dir rather than enforcing the pathsec boundary.\n```\n\nFor save_maxent_params(), the attacker-controlled tab_dir determines where the model parameter files are written.\n\nFor load_maxent_params(), the attacker-controlled tab_d\n\nAffected packages: pip:nltk\nPatched: nltk 3.10.4","url":"https://github.com/advisories/GHSA-59f9-gqg8-mqpj","published_at":"2026-11-16T14:46:25Z","updated_at":"2026-11-16T14:46:26Z","fetched_at":"2026-11-21T19:15:18.416974Z","severity":"medium","cvss_score":6.3,"epss":0.00376,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"nltk","vuln_id":"CVE-2026-126296","vuln_ids":["CVE-2026-126296","CVE-2026-15367","GHSA-59F9-GQG8-MQPJ"],"tags":["ghsa","pip","CWE-22"],"cluster_id":2670,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2611","html":"https://vulnwatch.ve1ve2.com/item/2611"}},{"id":5397,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-126296: NLTK before 3.10.4 contains a path traversal vulnerability in save_maxent_params() and load_maxent_params() that bypasses the pathsec filesystem restriction me…","summary":"NLTK before 3.10.4 contains a path traversal vulnerability in save_maxent_params() and load_maxent_params() that bypasses the pathsec filesystem restriction mechanism. Attackers who control the tab_dir argument can read or overwrite model parameter files outside permitted data roots, because the functions call Python's built-in open() directly.\n\nReferences:\nhttps://github.com/nltk/nltk/security/advisories/GHSA-59f9-gqg8-mqpj\nhttps://www.vulncheck.com/advisories/nltk-before-3.10.4-path-traversal-via-save-maxent-params-and-load-maxent-params\nhttps://github.com/nltk/nltk/security/advisories/GHSA-59f9-gqg8-mqpj","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126296","published_at":"2026-11-13T10:17:34.243000Z","updated_at":"2026-11-18T16:18:07.577000Z","fetched_at":"2026-11-21T19:15:31.480924Z","severity":"medium","cvss_score":6.3,"epss":0.00376,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-126296","vuln_ids":["CVE-2026-126296","CVE-2026-15367","GHSA-59F9-GQG8-MQPJ"],"tags":["CWE-73"],"cluster_id":1455,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/5397","html":"https://vulnwatch.ve1ve2.com/item/5397"}}]}