GitHub advisory · PyPI
NLTK: Path Traversal in save_maxent_params / load_maxent_params Allow Arbitrary File READ/WRITE
Description
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.
The affected functions are:
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:
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.
The issue can be reproduced by enabling NLTK's path security enforcement and…
Manual fix · PyPI
pip install --upgrade "nltk>=3.10.4"Sources