NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
🐍 PyPI
Not in CISA KEV

CVE-2026-126296 — nltk

Fix: nltk/nltk#3759

CVE-2026-126296 is a CWE-73 vulnerability in nltk. A fix is available for nltk — see the affected versions and patch details below.

NLTK before 3.10.4 Path Traversal via save_maxent_params and load_maxent_params

Also known asGHSA-59f9-gqg8-mqpj
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 16, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs20th percentile — riskier than 20% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

Real-World Exposure

1 pkg affected
🐍nltk

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Summary

Path traversal in NLTK's save_maxent_params() and load_maxent_params() allows arbitrary file write and arbitrary file read outside the directories permitted by NLTK's pathsec security mechanism.

This vulnerability was previously reported through Huntr, accepted by the NLTK project, and assigned CVE-2026-15367. A $750 bounty was paid through Huntr (i didnt get the fix bounty). Huntr subsequently shut down its OSS vulnerability program, so I am submitting this report through GitHub to continue the existing disclosure process and preserve the original CVE assignment and researcher credit.

Details

The affected functions are:

  • nltk.classify.maxent.load_maxent_params()
  • nltk.classify.maxent.save_maxent_params()

Both functions construct filesystem paths from the caller-controlled tab_dir argument and access them using Python's built-in open() without passing the paths through NLTK's pathsec validation.

For example, load_maxent_params() constructs and opens:

  • <tab_dir>/weights.txt
  • <tab_dir>/mapping.tab
  • <tab_dir>/labels.txt
  • <tab_dir>/alwayson.tab

Similarly, save_maxent_params() creates/writes files under the supplied tab_dir.

This bypasses the security boundary provided by nltk.pathsec. NLTK documents pathsec as the mechanism for restricting filesystem access to permitted roots, with strict enforcement intended to prevent unauthorized filesystem access.

The relevant implementation is in:

nltk/classify/maxent.py

The affected functions can be found in the model parameter loading/saving section of that file.

This issue was previously disclosed through Huntr and accepted before the Huntr OSS program was shut down. The original Huntr report was assigned CVE-2026-15367 and received a $750 bounty.

I am therefore submitting this GitHub Security Advisory primarily as a continuation/transfer of the existing disclosure rather than as a new vulnerability report.

PoC

The issue can be reproduced by enabling NLTK's path security enforcement and supplying a tab_dir outside the permitted root.

For example, with a controlled test environment:

import os
import tempfile
import nltk.pathsec as pathsec
from nltk.classify.maxent import load_maxent_params, save_maxent_params

pathsec.ENFORCE = True

allowed_dir = tempfile.mkdtemp()
outside_dir = tempfile.mkdtemp()

# The same outside-root path is rejected when accessed through pathsec.
try:
    with pathsec.open(os.path.join(outside_dir, "test.txt"), "w") as f:
        f.write("test")
except Exception as e:
    print("pathsec.open rejected outside-root access:", type(e).__name__)

# The vulnerable model-parameter APIs directly use open()
# on paths derived from tab_dir.
#
# Supplying outside_dir as tab_dir causes the functions to access
# files under outside_dir rather than enforcing the pathsec boundary.

For save_maxent_params(), the attacker-controlled tab_dir determines where the model parameter files are written.

For load_maxent_params(), the attacker-controlled tab_dir determines which files are read.

The important security property being bypassed is that pathsec.ENFORCE = True does not protect these file operations because the affected functions call the built-in open() directly rather than the pathsec-aware file-opening mechanism.

Impact

This is a path traversal / filesystem sandbox bypass resulting in arbitrary local file read and arbitrary local file write.

Applications that use NLTK's pathsec mechanism as a filesystem security boundary may incorrectly assume that model parameter loading and saving are restricted to approved directories.

An attacker who can influence the tab_dir argument may therefore:

  • read files outside the permitted NLTK data directories through load_maxent_params();
  • create or overwrite files outside the permitted directories through save_maxent_params();
  • bypass the filesystem containment provided by nltk.pathsec.

The practical impact depends on how an application exposes these APIs and what filesystem permissions the NLTK process has.

Existing CVE / Disclosure History

CVE: CVE-2026-15367

This vulnerability was previously reported and accepted through Huntr before the Huntr OSS vulnerability program was shut down. The report received a $750 bounty and a CVE was reserved.

I am submitting this report because the original Huntr disclosure workflow is no longer available and the CVE has not yet been published.

Please associate this report with CVE-2026-15367 rather than assigning a new CVE, unless the NLTK maintainers determine that the existing CVE does not correspond to this issue.

Fix status (2026-09-28)

Status: MERGED on develop. The load side is in every release since 3.9.4 (including v3.10.3); the save side is on develop and unreleased.

Fix commits: f2556f9e1 (load_maxent_params reads through open_datafile on a PathPointer whose open is pathsec.open; contained in tag 3.9.4 and every later tag) and 2a92b7182 (save_maxent_params validates tab_dir and writes every parameter file through pathsec.open), PR #3759 "Harden maxent / named-entity model-artifact saves against shared-tmp planting", merged 2026-08-18, merge commit a167e94bc on develop.

Probe: nltk/test/unit/security_probes/ghsa_59f9_gqg8_mqpj.py, added on the open PR #3753 (head da55cab0e at the time of this note; measured on its earlier head 238f81500) together with commit 15f84f036 (load_maxent_params accepts a plain str or Path through FileSystemPathPointer). Verdict on 238f81500: FIXED (save and load outside every data root refused by pathsec). The same probe run against develop 2fa3f48fe reports the save refused and a PathPointer load refused, while a str or Path tab_dir raises AttributeError before any file is opened (the probe counts that crash as not fixed; no file is read or written).

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPInltkall versions3.10.4pip install --upgrade 'nltk==3.10.4'

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for nltk, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update nltk to 3.10.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-126296 is resolved across your whole dependency graph.

  3. Workarounds

    Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.

Frequently Asked Questions

### Summary Path traversal in NLTK's save_maxent_params() and load_maxent_params() allows arbitrary file write and arbitrary file read outside the directories permitted by NLTK's pathsec security mechanism. This vulnerability was previously reported through Huntr, accepted by the NLTK project, and assigned CVE-2026-15367. A $750 bounty was paid through Huntr (i didnt get the fix bounty). Huntr subsequently shut down its OSS vulnerability program, so I am submitting this report through GitHub to continue the existing disclosure process and preserve the original CVE assignment and researcher cr
O3 Security · Impact-Aware SCA

Is CVE-2026-126296 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2026-126296: nltk Path Traversal — Fixed in 3.10.4