nltk
Affected
- introduced
0, fixed3.10.4(ecosystem)
Fixed versions
3.10.4
Fix
- Fixed version
3.10.4pip install --upgrade nltk==3.10.4
Advisory
Also known as: CVE-2026-81726, PYSEC-2026-3740
NLTK: Model-artifact APIs bypass pathsec and touch files outside allowed roots
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
TransitionParser.train, TransitionParser.parse, AveragedPerceptron.save, AveragedPerceptron.load, PerceptronTagger.save_to_json, save_maxent_params3.9.4 and current source v3.10.0-rc2 both reproduced.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
pathsec enforcement and lets untrusted workflows choose model import or export paths.Steps
pathsec.ENFORCE=True and restrict allowed roots to a dedicated sandbox directory.pathsec.open(), PerceptronTagger.load_from_json(), or load_maxent_params().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
High Basis: The source's own band: HIGH
0, fixed 3.10.4 (ecosystem)3.10.4
3.10.4pip install --upgrade nltk==3.10.4Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0