NLTK: Corpus Reader Sandbox Bypass

Published September 8, 2026 CVE-2026-79674

NLTK can let an attacker read local files an application meant to keep private. The attacker must control which data folder the application gives NLTK.

Severity
HighCVSS 3.1 · 8.2
Fix
Fixed in 3.10.3
Affected versions
before 3.10.3
Weakness
CWE-73
Exploit likelihood
0.23% in 30 daysEPSS, higher than 13% of known flaws
Affects
NLTK

How it works

  • An application must accept an untrusted data folder location for NLTK.
  • Affected versions convert that location before checking whether it is allowed.
  • Two affected readers then open the chosen text file or SQLite database directly.
  • This lets the application read files outside NLTK's permitted folders.

What to do

Run python3 -m pip show nltk in every application environment. Version 3.10.2 or earlier is affected. Finding that version does not prove exploitation. Exposure requires an untrusted caller to control the data folder location.

Run this in the application environment you want to check:

python3 -m pip show nltk

Upgrade NLTK to version 3.10.3 or later in every application environment. Rerun the version check and confirm it reports 3.10.3 or newer.

Technical details

CVE-2026-79674 affects NLTK corpus-reader constructors through version 3.10.2. LinThesaurusCorpusReader and PanLexLiteCorpusReader can accept caller-controlled root paths and read local text files or SQLite databases outside the pathsec sandbox. Version 3.10.3 validates reader roots before file access. It also checks the PanLex Lite database location before opening it.

Severity breakdown

  • Attack vector Network Requires network access to the vulnerable service
  • Attack complexity Low Low complexity under the assessed conditions
  • Privileges required None Attacker needs no account or login
  • User interaction None No victim action needed
  • Scope Unchanged Impact stays within the same security authority
  • Confidentiality impact High Sensitive data can be exposed with serious impact
  • Integrity impact Low Some data can be modified
  • Availability impact None No availability impact
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N Open in FIRST.org calculator

References