All vulnerabilities

PyPI

CVE-2026-126302

NLTK: Symlink escape in chat80.sql_query bypasses the pathsec data-root sandbox to read out-of-root SQLite databases

Severity
Medium 4.8
Published
13 Nov 2026
Last changed
16 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
3.10.4
Exploit chance
0.2% in the next 30 daysHigher than 9% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Link following (CWE-59)Path traversal (CWE-22)
Attack
Needs local access · Needs a user account · No user action needed
Attacker can
Read some data
CVSS vector
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Also known as
GHSA-xmfg-f9cm-w86q
Sources
CVE Program, OSV.dev and GitHub

Description

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.

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,…

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
nltkPyPI · osv:PyPI:nltk
  • From 3.9.4 before 3.10.4

About nltk

Weekly downloads (PyPI)
11,948,568PyPI Stats, 23 Nov 2026

References