gptline · NLTK: Symlink escape
Affects gptlineSource GCVE Database
Not known to be exploited · CVSS 4.8 Medium : upgrade to 1.0.8_25 when convenient.
Data as of 17 Nov 2026, 17:34 UTC
Thin evidence
One scorer or none| CNA (VulnCheck) | CVSS 4.0 | 4.8 |
|---|---|---|
| CNA (VulnCheck) | CVSS 3.1 | 3.3 |
- Patch
- Available – fixed in 1.0.8_25
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 13 Nov 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 16 Nov 2026.
What to do
Upgrade gptline to 1.0.8_25.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Homebrewgptlinepkg:brew/gptlineOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
## Summary `nltk.sem.chat80.sql_query()` opens a SQLite database by handing the result of `nltk.data.find(dbname)` straight to `sqlite3.connect()` without the path-containment check that the NLTK data sandbox (`nltk.pathsec`) is meant to enforce. `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. As a result, an in-root symbolic link that points at a SQLite file outside every registered NLTK data root is followed by SQLite, and the caller receives query results from the out-of-sandbox database. An attacker who can place a file inside a directory the application trusts as an NLTK data root can read SQLite databases that the pathsec sandbox is supposed to keep out of reach. ## Root Cause The security invariant is that file access performed through NLTK data resolution must stay within the configured data roots; the sandbox enforces this in `nltk.pathsec` via `validate_path` and `pathsec.open`, which resolve the real path (`Path(...).resolve()`) and reject targets outside the allowed roots. `sql_query()` never reaches that enforcement point. It calls `nltk.data.find(dbname)`, whose guards operate purely on the resource-name string, and `FileSystemPathPointer.__init__` performs only `os.path.abspath` plus an existence check, which does not collapse symlinks. The pointer is then passed to `sqlite3.connect(str(path))`, so the containment decision that `FileSystemPathPointer.open()` would delegate to `pathsec.open` is bypassed entirely. The sibling functions in the same module that create or write databases (`cities2table`, `val_dump`, `val_load`) obtain their protection from a validation call in later development, but the read sink `sql_query` performs no equivalent check in any published release. ```text nltk/sem/chat80.py -> sql_query(): path = nltk.data.find(dbname); sqlite3.connect(str(path)) nltk/data.py -> find(): lexical name guards only; returns FileSystemPathPointer nltk/data.py -> FileSystemPathPointer.__init__(): os.path.abspath + os.path.exists (no symlink resolution) nltk/data.py -> FileSystemPathPointer.open() -> nltk.pathsec.open (the containment guard that sql_query never calls) ``` ## Impact An attacker who can write into a directory the application registers as an NLTK data root (a shared or writable corpus directory, or a downloaded corpus) can plant a symbolic link at the expected resource location that points at a SQLite database elsewhere on the filesystem. When the application invokes `sql_query()` (directly or via `sql_demo()`) for that resource, SQLite follows the link and the query executes against the out-of-sandbox database, returning its rows to the caller. This escapes the pathsec confidentiality boundary. The read primitive is bounded to SQLite-format files that are readable by the process user: a non-SQLite target raises `sqlite3.DatabaseError` rather than leaking content. A caller-supplied write query would be redirected onto the out-of-sandbox target and SQLite may create sidecar files (`-wal`, `-journal`) next to it, which is a plausible integrity side effect rather than a demonstrated arbitrary-write primitive. Exploitation requires the same local write capability into a trusted data root as the related symlink-read sandbox-escape issues already recorded for this project. ## Proof of Concept `Requires the published nltk 3.10.3 wheel and a writable directory registered as an NLTK data root. No network access is needed.` 1. Create a throwaway data root with the expected corpus subdirectory. 2. Create a SQLite database outside that root and populate it. 3. Plant an in-root symbolic link at `corpora/city_database/city.db` pointing at the outside database. 4. Register the data root and call `sql_query()` for the in-root resource name. ```python import os, tempfile, sqlite3, nltk, nltk.data from nltk.sem import chat80 work = 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 ``` ```text open() blocked: PermissionError sql_query rows: [('OUT-OF-SANDBOX-SECRET',)] ``` ## Attack Chain 1. **Exposure:** The application exposes `sql_query()` (or `sql_demo()`, which calls it) and resolve