{"id":"CVE-2026-81726","aliases":["CVE-2026-81726","GHSA-8mgp-746c-j5xp","PYSEC-2026-3740"],"related":[],"kind":"vulnerability","state":"published","title":"NLTK through 3.10.3 Path Traversal via Model-Artifact APIs","summary":"NLTK through 3.10.3 contains a path traversal vulnerability in model-artifact APIs that bypass pathsec enforcement by using raw file operations on caller-controlled paths. Attackers can read or write files outside allowed sandbox roots through TransitionParser, AveragedPerceptron, PerceptronTagger, and maxent parameter APIs when pathsec is enabled.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"NLTK through 3.10.3 contains a path traversal vulnerability in model-artifact APIs that bypass pathsec enforcement by using raw file operations on caller-controlled paths. Attackers can read or write files outside allowed sandbox roots through TransitionParser, AveragedPerceptron, PerceptronTagger, and maxent parameter APIs when pathsec is enabled.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nSeveral model-artifact APIs still treat caller-controlled model paths as ordinary filenames even when NLTK path security is enforced. The same outside-root paths are rejected by guarded helpers, but these public read and write flows still use raw file APIs.\n\n### Details\n\n- **Vulnerability type:** File sandbox bypass\n- **Affected component:** `TransitionParser.train`, `TransitionParser.parse`, `AveragedPerceptron.save`, `AveragedPerceptron.load`, `PerceptronTagger.save_to_json`, `save_maxent_params`\n- **Affected versions:** Published `3.9.4` and current source `v3.10.0-rc2` both reproduced.\n- **Patched versions:** Not yet patched\n- **Root cause:** Model import and export helpers use built-in `open()` on caller-controlled paths instead of pathsec-aware helpers.\n\n`TransitionParser.train()` writes outside allowed roots, `TransitionParser.parse()` reads outside allowed roots, `AveragedPerceptron` bypasses the sandbox in both directions, and adjacent read-side helpers in the same family already show the intended guarded behavior. I confirmed outside-root reads and writes while `pathsec.open()` or the guarded sibling helpers rejected the same paths.\n\n### PoC\n\n**Preconditions**\n- The application enables `pathsec` enforcement and lets untrusted workflows choose model import or export paths.\n\n**Steps**\n1. Enable `pathsec.ENFORCE=True` and restrict allowed roots to a dedicated sandbox directory.\n2. Use public model import or export APIs with paths that point outside that root.\n3. Observe the same paths are rejected by negative-control guarded helpers such as `pathsec.open()`, `PerceptronTagger.load_from_json()`, or `load_maxent_params()`.\n4. Observe the vulnerable APIs still read or write outside-root files successfully.\n\n**Minimal reproducible excerpt**\n\n```text\ntransition_train_exists True\ntransition_parse_loader_read_bytes 13\naveraged_load_keys ['bias']\nmaxent_save wrote ['alwayson.tab', 'labels.txt']\n```\n\n### Impact\n\nConsumers that rely on `pathsec` for local containment can be tricked into reading or overwriting files outside approved roots through normal model persistence and loading APIs.\n\n### Remediation\n\nRoute all model-path file access through `nltk.pathsec.open()` or existing pathsec-aware helpers, and add regression tests that pair each vulnerable API with a negative control on the same path.\n\n### References\n\n- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/parse/transitionparser.py#L551-L571\n- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/tag/perceptron.py#L106-L113\n- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/tag/perceptron.py#L262-L273\n- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/classify/maxent.py#L1583-L1602","format":"markdown","source":"ghsa"}],"published":"2026-08-27T14:51:18.838Z","modified":"2026-11-02T22:15:04.414Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N","score":8.3,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L","score":7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L","score":7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"}],"cwes":["CWE-22","CWE-59","CWE-73"],"affected":[{"ranges":[{"type":"semver","introduced":"0","lastAffected":"3.10.3","status":"affected"},{"type":"semver","version":"3.10.4","status":"unaffected"}],"vendor":"nltk","product":"nltk","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.10.4"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.10.3"}],"vendor":"nltk","product":"nltk","cpe":"cpe:2.3:a:nltk:nltk:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.10.3"}],"ecosystem":"PyPI","package":"nltk","purl":"pkg:pypi/nltk","source":"pysec"}],"references":[{"url":"https://github.com/nltk/nltk/security/advisories/GHSA-8mgp-746c-j5xp","tags":["evidence","exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.vulncheck.com/advisories/nltk-through-3.10.3-path-traversal-via-model-artifact-apis","tags":["advisory","third-party-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-81726","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/pull/3757","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/pull/3759","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/pull/3813","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/commit/2a92b71827d754ae8920261e7ed0c4bb283ab2d7","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/commit/a44a7af69bca87e92d9c4a701fcbbe4512e8d450","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk/commit/cbc98458b43de5f792f0382583c16df39e5c5117","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nltk/nltk","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3740.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-08-27T19:29:05.374Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-81726","url":"https://www.cve.org/CVERecord?id=CVE-2026-81726","licence":"CVE Terms of Use","modified":"2026-10-30T10:43:25.836Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8mgp-746c-j5xp","url":"https://github.com/advisories/GHSA-8mgp-746c-j5xp","licence":"CC-BY-4.0","modified":"2026-11-02T22:15:04.414Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-81726","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-81726","licence":"Public domain","modified":"2026-10-30T11:17:33.577Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3740","url":"https://osv.dev/vulnerability/PYSEC-2026-3740","licence":"CC-BY-4.0","modified":"2026-09-01T09:15:03.463Z"}],"updatedAt":"2026-11-25T22:59:35.517Z","epss":{"score":0.00358,"percentile":0.31529,"date":"2026-12-01T12:00:22.000Z"}}