Live › vulnerability › CVE-2026-81726
NLTK's model import and export functions (perceptron tagger, transition parser, maxent) use plain file opens on caller-supplied paths, ignoring the pathsec restriction that other helpers enforce. An application that relies on pathsec to contain model file access can have files outside its allowed directories read or overwritten.
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-11-02 22:08 UTC, 0h before NVD. All times on this page are UTC.
Applications that use NLTK model import or export functions and let untrusted input choose the file path, and that depend on NLTK's pathsec setting to keep those paths inside an approved directory. Code that only loads models from fixed, trusted paths is much less exposed. Projects that do not use these model APIs can skip it.
| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| nltk | pypi | <= 3.10.3 | 3.10.4 |
| nltk | vendor | < 3.10.3 | 3.10.3 |
pip show nltk; affected versions are 3.10.3 and below.TransitionParser.train, , , , or , especially where the path comes from user input or a workflow.TransitionParser.parseAveragedPerceptron.saveAveragedPerceptron.loadPerceptronTagger.save_to_jsonsave_maxent_paramspathsec.ENFORCE is set to True in your application.3.10.4 (the fixed version named in the advisory data).Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
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.
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.
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']
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.
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.
This page as .md · .json · in your agent: get_signal("CVE-2026-81726")
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.