Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade nltk to version 3.10.4 or higher.
nltk is a Natural Language Toolkit (NLTK) is a Python package for natural language processing.
Affected versions of this package are vulnerable to Insertion of Sensitive Information into Externally-Accessible File or Directory via the StreamBackedCorpusView.__init__ constructor in nltk/corpus/reader/util.py, which calls os.stat(self._fileid).st_size on a caller-supplied plain string path with no pathsec validation. When an attacker can influence the fileid string passed to the constructor, the eager stat discloses whether an arbitrary out-of-root file exists, its exact byte size, and its modification time, even when nltk.pathsec.ENFORCE is True. On a missing or inaccessible path the constructor raises a ValueError whose message embeds the underlying OS error, allowing the attacker to distinguish ENOENT, EACCES, and ENOTDIR, providing a filesystem existence and permission oracle. File content is not disclosed: iteration of the view still routes through the sandboxed _open and is refused by pathsec.
Note: This is only exploitable when application code passes an attacker-influenced plain string directly to the StreamBackedCorpusView public constructor; in-tree corpus readers pass validated PathPointer objects and take the guarded branch.
Requires nltk 3.10.0 through 3.10.3 installed (the pathsec-hardened line). No non-default configuration; pathsec ENFORCE defaults to True. Reproduced against the published PyPI sdist nltk==3.10.3.
_eofpos (the leaked size) without iterating the view.import os import nltk.pathsec as ps from nltk.corpus.reader.util import StreamBackedCorpusView as Vprint("ENFORCE", ps.ENFORCE) # True (default)
v = V("/etc/passwd", lambda s: [s.read()]) print("size leaked", v._eofpos, "real", os.stat("/etc/passwd").st_size)
try: "".join(list(v)) # attempt content read except Exception as e: print("content blocked", type(e).name)
ENFORCE True
size leaked 1850 real 1850
content blocked PermissionError # Security Violation [pathsec.open]: Unauthorized path /etc/passwd
A nonexistent path instead raises ValueError: Unable to open or access '/etc/nonexistent_xyz' -- [Errno 2] No such file or directory, providing the existence and error class oracle.
Note: Reproduced against the published PyPI sdist nltk==3.10.3 with no non-default configuration and pathsec ENFORCE defaulting to True.