CVE-2026-81726: NLTK: Model-artifact APIs bypass pathsec and touch files outside allowed roots

Published Aug 27, 2026
·
Updated

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.savetojson, savemaxentparams - Affected versions: Published 3.9.4 and current source v3.10.0-rc2 both 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 pathsec enforcement and lets untrusted workflows choose model import or export paths.

Steps 1. Enable pathsec.ENFORCE=True and restrict allowed roots to a dedicated sandbox directory. 2. Use public model import or export APIs with paths that point outside that root. 3. Observe the same paths are rejected by negative-control guarded helpers such as pathsec.open(), PerceptronTagger.loadfromjson(), or loadmaxentparams(). 4. Observe the vulnerable APIs still read or write outside-root files successfully.

Minimal reproducible excerpt

text transitiontrainexists True transitionparseloaderreadbytes 13 averagedloadkeys ['bias'] maxentsave 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.

Other sources

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.

— MITRE

Affected Software

10 affected componentsFixes available
nltk nltk<=3.10.3
pip/nltk<=3.10.3
nltk nltk<3.10.3
debian/nltk*
debian/nltk*
debian/nltk*
debian/nltk<=3.8-1, <=3.9.1-2, <=3.10.3-1
pip/nltk<3.10.4
3.10.4
ubuntu/nltk*
IBM API Connect<=V10.0.8.0 - V10.0.8.13

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/nltk to a version that resolves this vulnerability.

    Fixed in 3.10.4
  2. Configuration

    Enable pathsec enforcement by setting pathsec.ENFORCE=True.

    NLTK pathsec pathsec.ENFORCE = True
  3. Compensating control

    Restrict pathsec allowed roots to a dedicated sandbox directory so model import and export paths remain contained.

  4. Compensating control

    Route all model-path file access through nltk.pathsec.open() or existing pathsec-aware helpers, and add regression tests pairing each affected API with a negative control on the same path.

Event History

Aug 27, 2026
CVE Published
via MITRE·02:51 PM
Data Sourced
via MITRE·02:51 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:21 PM
DescriptionSeverityWeaknessAffected Software
Sep 2, 2026
Advisory Published
via GitHub·02:35 PM
Data Sourced
via GitHub·02:35 PM
DescriptionSeverityWeaknessAffected Software
Nov 17, 2026
Data Sourced
via OSV·06:23 PM
Affected Software
Nov 18, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

Which applications are realistically exposed to this issue?

Applications using NLTK through 3.10.3 are exposed when they enable pathsec and pass attacker-controlled paths to the affected model-artifact APIs: TransitionParser, AveragedPerceptron, PerceptronTagger, or maxent parameter APIs.

2

What does an attacker need to exploit the vulnerability?

An attacker needs a way to influence a file path supplied to one of the affected APIs. No privileges or user interaction are required according to the provided vector, but exploitation has high attack complexity.

3

Does enabling pathsec protect affected applications?

No. The issue specifically bypasses pathsec enforcement because the affected APIs use raw file operations on caller-controlled paths, allowing reads or writes outside configured sandbox roots.

4

How can I determine whether my application is affected?

Review whether it uses NLTK through 3.10.3, has pathsec enabled, and invokes the listed model-artifact APIs with paths derived from untrusted input. Such paths may permit access outside the intended sandbox root.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203