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 applicationsLearn about External Control of File Name or Path vulnerabilities in an interactive lesson.
Start learningUpgrade 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 External Control of File Name or Path via BllipParser.__init__ in nltk/parse/bllip.py, which passes caller-supplied filesystem paths directly to the native bllipparser C extension without routing them through NLTK's pathsec validation. The constructor parameters parser_model, reranker_features, and reranker_weights, as well as the model_dir argument of from_unified_model_dir(), flow unchanged to the C extension's load_parser_model() and load_reranker_model() calls, which open and read the given path at the OS level. An attacker who can influence any of these path arguments can designate an arbitrary file outside the NLTK data roots - including local configuration or credential files readable by the process - for the extension to open and read, bypassing the pathsec data-root confinement that every other NLTK native-tool wrapper enforces. Additionally, supplying a non-regular file (FIFO, socket, device, or directory) or an oversized regular file can cause the native loader to block or read unbounded data into memory, crashing the worker.
Note: This is only exploitable when the optional bllipparser C extension is installed (pip install bllipparser) and an application passes attacker-influenced input as a model path to BllipParser.
Requires the optional bllipparser C extension to be installed
(pip install bllipparser) so that RerankingParser.load_parser_model
is available. No NLTK data download is needed to exercise the path.
# An application forwards an untrusted "model" path into BllipParser.
from nltk.parse.bllip import BllipParser
# Attacker-controlled value reaches the constructor unchanged.
untrusted_path = "/etc/passwd"
BllipParser(parser_model=untrusted_path)
# The bllipparser C extension opens and reads untrusted_path at the OS
# level with no NLTK pathsec confinement to the data roots.
Structural confirmation without the optional extension installed:
$ grep -n "pathsec\|validate_path\|validate_tool" nltk/parse/bllip.py
(no output)
$ grep -n "validate_tool_path" nltk/tag/crf.py nltk/tag/hunpos.py \
nltk/tag/stanford.py nltk/parse/malt.py
nltk/tag/crf.py:140
nltk/tag/crf.py:311
nltk/tag/hunpos.py:111
nltk/tag/stanford.py:85
nltk/tag/stanford.py:137
nltk/parse/malt.py:340
nltk/parse/malt.py:344
BllipParser is the only native-tool wrapper with no validate_tool_path call.
Note: Requires the optional bllipparser C extension to be installed via pip; no NLTK data download is needed.