CVE-2026-81726 — Vulnerability in nltk — CVE Details
NLTK: Model-artifact APIs bypass pathsec and touch files outside allowed roots
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.34%). Schedule for your next planned update.
Does your project use an affected nltk version?
Paste your requirements.txt to check it for CVE-2026-81726 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
Several 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.
Details
- Vulnerability type: File sandbox bypass
- Affected component:
TransitionParser.train,TransitionParser.parse,AveragedPerceptron.save,AveragedPerceptron.load,PerceptronTagger.save_to_json,save_maxent_params - Affected versions: Published
3.9.4and current sourcev3.10.0-rc2both reproduced. - Patched versions: Not yet patched
- Root cause: Model import and export helpers use built-in
open()on caller-controlled paths instead of pathsec-aware helpers.
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.
PoC
Preconditions
- The application enables
pathsecenforcement and lets untrusted workflows choose model import or export paths.
Steps
- Enable
pathsec.ENFORCE=Trueand restrict allowed roots to a dedicated sandbox directory. - Use public model import or export APIs with paths that point outside that root.
- Observe the same paths are rejected by negative-control guarded helpers such as
pathsec.open(),PerceptronTagger.load_from_json(), orload_maxent_params(). - Observe the vulnerable APIs still read or write outside-root files successfully.
Minimal reproducible excerpt
transition_train_exists True
transition_parse_loader_read_bytes 13
averaged_load_keys ['bias']
maxent_save wrote ['alwayson.tab', 'labels.txt']
Impact
Consumers 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.
Remediation
Route 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.
References
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/parse/transitionparser.py#L551-L571
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/tag/perceptron.py#L106-L113
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/tag/perceptron.py#L262-L273
- https://github.com/nltk/nltk/blob/v3.10.0-rc2/nltk/classify/maxent.py#L1583-L1602
Advisory Timeline
- First published September 2, 2026 (85 days ago).
- Last revised November 2, 2026 — 61 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "nltk>=3.10.4"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| nltk PyPI · Affected: 0.8, 0.9, 0.9.3, 0.9.4 (+65 more) | 3.10.4 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-22Path TraversalMITRE
- CWE-59
- CWE-73
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.0 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L
References
- https://github.com/nltk/nltk/security/advisories/GHSA-8mgp-746c-j5xpWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-81726ADVISORY
- https://github.com/nltk/nltk/pull/3757WEB
- https://github.com/nltk/nltk/pull/3759WEB
- https://github.com/nltk/nltk/pull/3813WEB
- https://github.com/nltk/nltk/commit/2a92b71827d754ae8920261e7ed0c4bb283ab2d7WEB
- https://github.com/nltk/nltk/commit/a44a7af69bca87e92d9c4a701fcbbe4512e8d450WEB
- https://github.com/nltk/nltk/commit/cbc98458b43de5f792f0382583c16df39e5c5117WEB
- https://github.com/nltk/nltkPACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/nltk/PYSEC-2026-3740.yamlWEB
- https://www.vulncheck.com/advisories/nltk-through-3.10.3-path-traversal-via-model-artifact-apisWEB
Frequently Asked Questions
- What is CVE-2026-81726?
- NLTK: Model-artifact APIs bypass pathsec and touch files outside allowed roots. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.0/10).
- How do I check if my project is affected by CVE-2026-81726?
- CVE-2026-81726 affects nltk. It has a 0.3% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-81726 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 19.8% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-0848CRITICAL
- CVE-2026-62388HIGH
- CVE-2026-63311HIGH
- CVE-2026-78682HIGH
NLTK: pathsec SSRF protection can be bypassed when a proxy is configured
- CVE-2026-128134HIGH
NLTK dot2img runs Graphviz 'dot' without the trusted-exec chokepoint, enabling local code execution via a writable PATH element
- CVE-2026-79676HIGH
NLTK: Corpus readers follow symlinks outside trusted roots despite pathsec enforcement
- CVE-2026-65915MEDIUM
NLTK: FileSystemPathPointer.open() sandbox check is dead code — arbitrary file read via file:// protocol
- CVE-2026-128140MEDIUM
NLTK: Downloader cyclic collection indices cause an infinite closure walk